/* ONTECH.LOCAL Samba Manager — Modern Light Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e2e8f0;
    --accent: #32373c;
    --primary: #2563eb;
    --success: #16a34a;
    --info: #0284c7;
    --warning: #d97706;
    --danger: #dc2626;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --sidebar-width: 240px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--primary); }

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    color: var(--accent);
    font-size: 1.05em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-subtitle {
    color: var(--text-muted);
    font-size: 0.75em;
    margin-top: 2px;
}

.nav-links {
    list-style: none;
    flex: 1;
    padding: 12px 0;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-links li a:hover {
    color: var(--text);
    background: var(--bg);
}

.nav-links li a.active {
    color: var(--primary);
    background: #eff6ff;
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-icon {
    margin-right: 10px;
    font-size: 0.85em;
    width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 20px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.82em;
}

.user-info {
    margin-bottom: 8px;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    max-width: 1400px;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--bg);
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-header h1 {
    color: var(--accent);
    font-size: 1.5em;
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card h2 {
    color: var(--accent);
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card.full-width {
    grid-column: 1 / -1;
}

/* Stat boxes */
.stat-row {
    display: flex;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.stat-box {
    background: var(--card);
    padding: 20px 24px;
    border-radius: var(--radius);
    text-align: center;
    flex: 1;
    min-width: 150px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-box .number {
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
}

.stat-box .label {
    color: var(--text-muted);
    font-size: 0.82em;
    margin-top: 4px;
    font-weight: 500;
}

.stat-box.danger .number { color: var(--danger); }
.stat-box.success .number { color: var(--success); }
.stat-box.info .number { color: var(--info); }
.stat-box.warning .number { color: var(--warning); }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background: var(--bg);
}

tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 600;
}

.badge-red { background: #fef2f2; color: var(--danger); }
.badge-green { background: #f0fdf4; color: var(--success); }
.badge-blue { background: #eff6ff; color: var(--primary); }
.badge-yellow { background: #fffbeb; color: var(--warning); }
.badge-gray { background: #f1f5f9; color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    color: #fff;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-warning { background: var(--warning); color: #fff; }

.btn-sm {
    padding: 5px 12px;
    font-size: 0.82em;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 0.88em;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.92em;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    appearance: auto;
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: end;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* Search bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.92em;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar input::placeholder {
    color: var(--text-light);
}

/* Login form */
.login-card {
    background: var(--card);
    padding: 48px 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
}

.login-card h1 {
    color: var(--accent);
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 32px;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95em;
}

/* Flash messages */
.flash-container {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88em;
    font-weight: 500;
}

.flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.flash-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.flash-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.flash-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
}

.flash-close:hover {
    opacity: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-weight: 600;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.92em;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Pre/code blocks */
pre {
    background: var(--bg);
    padding: 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    overflow-x: auto;
    font-size: 0.82em;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Detail view */
.detail-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px 20px;
    font-size: 0.9em;
}

.detail-key {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    word-break: break-all;
    color: var(--text);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    margin-top: 20px;
    justify-content: center;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.15s ease;
}

.pagination a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Actions bar */
.actions-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Tag list (group memberships, etc.) */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 500;
    color: var(--text);
}

.tag .tag-remove {
    color: var(--danger);
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    margin-left: 2px;
    font-size: 1.1em;
    line-height: 1;
}

.tag .tag-remove:hover {
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-header h2,
    .sidebar-subtitle,
    .nav-links li a span:not(.nav-icon),
    .sidebar-footer .user-info span,
    .sidebar-footer .logout-btn {
        display: none;
    }
    .nav-links li a {
        justify-content: center;
        padding: 14px 8px;
    }
    .nav-icon { margin: 0; }
    .main-content {
        margin-left: 60px;
        padding: 20px;
    }
    .stat-row {
        flex-direction: column;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
}
