/* Homebrew CRM - Standard Stylesheet */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f4f6f9;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-radius: 8px;
    --spacing-unit: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--background-color);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    padding: 0.75rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Container System */
.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto 2rem auto;
    padding: 0;
    display: block;
    clear: both;
}

.container-narrow { max-width: 800px; }
.container-mid { max-width: 1000px; }
.container-tight { max-width: 600px; }

/* Cards */
.card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    width: 100%;
}

/* Typography */
h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.section-header { 
    margin-bottom: 1.5rem; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 0.5rem; 
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: white;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
button, .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s;
    width: auto; /* Buttons should not be full-width by default unless in mobile */
}

button:hover, .btn:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Grid Utilities */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 15px;
    flex-wrap: wrap;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.name-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.name-link:hover {
    text-decoration: underline;
}

.icon-link {
    text-decoration: none;
    font-size: 1.2rem;
    color: var(--secondary-color);
    cursor: pointer;
    transition: transform 0.1s;
    display: inline-block;
}

.icon-link:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    text-align: center;
    border: 1px solid transparent;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-name {
    font-weight: bold;
    padding: 5px 10px;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #eee;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.user-menu:hover .dropdown-content {
    display: block;
}

.dropdown-divider { border-top: 1px solid #eee; margin: 5px 0; }
.dropdown-header { padding: 8px 16px; font-size: 0.75rem; color: #999; font-weight: bold; text-transform: uppercase; }

/* Modals */
.modal-overlay {
    display:none; 
    position:fixed; 
    top:0; 
    left:0; 
    width:100%; 
    height:100%; 
    background:rgba(0,0,0,0.5); 
    z-index:1000;
}

.modal-content {
    background:white; 
    max-width:500px; 
    margin: 100px auto; 
    padding:2rem; 
    border-radius:8px; 
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
@media (max-width: 768px) {
    .container {
        width: 98%;
        margin-top: 1rem;
    }
    
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .nav-links {
        margin-top: 1rem;
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    button, .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
