/* Apartment Maintenance System - Modern UI */

:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --primary-soft: #f0fdfa;
    --accent: #0284c7;
    --secondary: #64748b;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --bg: #f4f7fb;
    --bg-alt: #eef2f7;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 10px 24px -4px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.15);
    --header-h: 68px;
    --gradient-hero: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #0891b2 100%);
    --gradient-subtle: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: .95rem;
    color: var(--text);
    text-decoration: none;
}

.logo:hover { text-decoration: none; color: var(--text); }

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--gradient-hero);
    color: #fff;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.logo-text {
    max-width: 180px;
    line-height: 1.2;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px 20px;
    box-shadow: var(--shadow);
}

.main-nav.open { display: flex; }

.main-nav a {
    padding: 12px 14px;
    color: var(--text);
    font-weight: 600;
    font-size: .925rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

.main-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-decoration: none;
}

.nav-staff {
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
    margin-top: 4px;
}

.nav-logout { color: var(--danger) !important; }

@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .main-nav {
        display: flex;
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }
    .main-nav a { padding: 9px 16px; }
    .nav-staff { margin-top: 0; }
    .logo-text { max-width: none; }
}

@media (max-width: 767px) {
    .logo-text { display: none; }
}

/* Main */
.main-content {
    flex: 1;
    padding: 28px 0 56px;
}

/* Hero banner (home) */
.hero-banner {
    background: var(--gradient-hero);
    border-radius: calc(var(--radius) + 4px);
    padding: 48px 28px;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 18px;
}

.hero-banner h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 14px;
    letter-spacing: -.02em;
}

.hero-line {
    display: block;
}

.hero-banner p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 28px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

@media (min-width: 480px) {
    .hero-banner { padding: 56px 40px; }
    .hero-banner h1 { font-size: 2.35rem; }
    .hero-actions { flex-direction: row; justify-content: center; }
}

/* Legacy hero (other pages) */
.hero {
    text-align: center;
    padding: 32px 0 40px;
}

.hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -.02em;
}

.hero p {
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 24px;
}

/* Features */
.features {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

@media (min-width: 640px) {
    .features { grid-template-columns: repeat(3, 1fr); }
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: transform .2s, box-shadow .2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.feature-icon-blue { background: #dbeafe; color: #1d4ed8; }
.feature-icon-teal { background: #ccfbf1; color: #0f766e; }
.feature-icon-green { background: #d1fae5; color: #059669; }

.feature-card h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-muted);
    font-size: .9rem;
    line-height: 1.6;
}

/* How it works */
.how-it-works {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.section-header {
    text-align: center;
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -.02em;
}

.section-header p {
    color: var(--text-muted);
    font-size: .95rem;
}

.steps-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 640px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .steps-grid { grid-template-columns: repeat(4, 1fr); }
}

.step-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 22px 18px;
    text-align: center;
    transition: border-color .2s, background .2s;
}

.step-card:hover {
    background: var(--primary-soft);
    border-color: #99f6e4;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-hero);
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    border-radius: 50%;
    margin-bottom: 12px;
}

.step-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.step-card p {
    color: var(--text-muted);
    font-size: .85rem;
    line-height: 1.55;
}

.steps {
    padding-left: 20px;
    color: var(--text-muted);
}

.steps li { margin-bottom: 10px; }

/* Typography */
.page-title {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -.02em;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: .95rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .925rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s ease;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
    background: var(--gradient-hero);
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover {
    color: #fff;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}

.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border-color: #fff;
}

.btn-yellow {
    background: #facc15;
    color: #1e293b;
    box-shadow: 0 4px 14px rgba(250, 204, 21, 0.45);
}

.btn-yellow:hover {
    background: #eab308;
    color: #0f172a;
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.5);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 7px 14px; font-size: .8125rem; }
.btn-block { width: 100%; }

/* Forms */
.form-card, .card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 22px;
}

.form-card fieldset {
    border: none;
    margin-bottom: 28px;
}

.form-card legend {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-soft);
    width: 100%;
    color: var(--text);
}

.form-grid {
    display: grid;
    gap: 18px;
}

@media (min-width: 640px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-group-full { grid-column: 1 / -1; }
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: .8125rem;
    margin-bottom: 7px;
    color: var(--text);
}

.required { color: var(--danger); }

.form-group input,
.form-group select,
.form-group textarea,
.filter-input,
.filter-select,
.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.filter-input:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.form-hint { display: block; color: var(--text-muted); font-size: .8rem; margin-top: 5px; }
.form-actions { margin-top: 10px; }
.form-group-inline { margin: 8px 0 12px; font-size: .9rem; }

@media (max-width: 639px) {
    .form-actions {
        display: flex;
        justify-content: center;
    }

    .form-actions .btn {
        min-width: 220px;
    }
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    font-size: .925rem;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.alert-success { background: #ecfdf5; color: #065f46; border-left-color: var(--success); }
.alert-error { background: #fef2f2; color: #991b1b; border-left-color: var(--danger); }
.alert-info { background: #f0f9ff; color: #075985; border-left-color: var(--info); }

.error-list { padding-left: 18px; }

/* Success panel */
.success-panel {
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 44px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.success-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 22px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.2);
}

.reference-box {
    background: var(--primary-soft);
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 22px 20px;
    margin: 26px auto;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.reference-label {
    display: block;
    width: 100%;
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

.reference-number {
    display: block;
    width: 100%;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: .03em;
    font-family: 'Consolas', monospace;
    line-height: 1.4;
    white-space: nowrap;
    word-break: keep-all;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.reference-box .reference-number {
    text-align: center;
}

.reference-copy-btn {
    min-width: 120px;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 26px;
}

@media (min-width: 480px) {
    .success-actions { flex-direction: row; justify-content: center; }
}

/* Search / Track */
.search-form { margin-bottom: 26px; }

.search-input-group {
    display: flex;
    gap: 10px;
    flex-direction: column;
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

@media (min-width: 480px) {
    .search-input-group { flex-direction: row; align-items: stretch; }
    .search-input { flex: 1; }
}

.track-result {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 28px;
}

.track-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.track-header-ref {
    flex: 1;
    min-width: 0;
}

.track-header .reference-number {
    font-size: clamp(0.82rem, 3.8vw, 1.35rem);
    margin: 0;
    width: auto;
    max-width: 100%;
}

@media (max-width: 480px) {
    .track-header {
        flex-direction: column;
        align-items: stretch;
    }

    .track-header .badge {
        align-self: flex-start;
    }
}

/* Detail grid */
.detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .detail-grid { grid-template-columns: 1fr 1fr; }
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.detail-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.detail-value { font-weight: 600; font-size: .925rem; }
.detail-section { margin-top: 26px; }
.detail-section h3 { margin-bottom: 12px; font-size: 1.05rem; font-weight: 700; }
.description-text { color: var(--text); white-space: pre-wrap; line-height: 1.7; }
.text-muted { color: var(--text-muted); font-size: .9rem; }

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.badge-submitted { background: #e0e7ff; color: #3730a3; }
.badge-assigned { background: #fef3c7; color: #92400e; }
.badge-progress { background: #dbeafe; color: #1e40af; }
.badge-resolved { background: #d1fae5; color: #065f46; }
.badge-closed { background: #f1f5f9; color: #475569; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-priority-low { background: #f1f5f9; color: #64748b; }
.badge-priority-medium { background: #fef3c7; color: #92400e; }
.badge-priority-high { background: #ffedd5; color: #c2410c; }
.badge-priority-urgent { background: #fee2e2; color: #991b1b; }
.badge-internal { background: #f3e8ff; color: #6b21a8; }

/* Timeline */
.timeline { position: relative; padding-left: 28px; }

.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: -28px;
    top: 6px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 20px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item:last-child::before { display: none; }

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.timeline-date { font-size: .8rem; color: var(--text-muted); }

/* Photos */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.photo-item { display: flex; flex-direction: column; gap: 8px; }

.photo-thumb {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.photo-section-hint { margin: -8px 0 14px; font-size: .85rem; }
.photo-delete-form { margin: 0; }

.btn-photo-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    background: #fff;
    color: #b91c1c;
    font-size: .8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.btn-photo-delete:hover { background: #fef2f2; }

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 65vh;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    width: 100%;
    max-width: 420px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 6px;
    font-weight: 800;
    font-size: 1.5rem;
}

.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 28px; }
.login-form .form-group { margin-bottom: 18px; }
.login-back { text-align: center; margin-top: 22px; font-size: .9rem; }

/* Dashboard */
.dashboard-header { margin-bottom: 28px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(5, 1fr); }
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all .2s;
}

.stat-card-link:hover {
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.stat-warning.stat-card-active { border-color: var(--warning); box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.12); }
.stat-info.stat-card-active { border-color: var(--info); box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.12); }
.stat-success.stat-card-active { border-color: var(--success); box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12); }
.stat-danger.stat-card-active { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }

.active-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--primary-soft);
    border: 1px solid #99f6e4;
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    margin-bottom: 18px;
    font-size: .9rem;
}

.stat-value { display: block; font-size: 1.85rem; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-top: 4px; }
.stat-warning .stat-value { color: var(--warning); }
.stat-info .stat-value { color: var(--info); }
.stat-success .stat-value { color: var(--success); }
.stat-danger .stat-value { color: var(--danger); }

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
    align-items: center;
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filter-input { flex: 1; min-width: 140px; }
.filter-input-sm { max-width: 140px; }
.filter-select { min-width: 130px; width: auto; }

/* Table */
.table-responsive {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg);
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}

.data-table tbody tr:hover { background: var(--primary-soft); }
.clickable-row { cursor: pointer; }
.empty-row { text-align: center; color: var(--text-muted); padding: 36px !important; }
.cell-truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dashboard complaint cards */
.complaint-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.complaint-cards-empty {
    text-align: center;
    padding: 36px 20px;
}

.complaint-card {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: all .2s;
}

.complaint-card:hover {
    text-decoration: none;
    border-color: #99f6e4;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.complaint-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.complaint-card-ref {
    font-weight: 800;
    font-size: .925rem;
    color: var(--primary-dark);
    font-family: 'Consolas', monospace;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 100%;
}

.complaint-card-rows { display: flex; flex-direction: column; gap: 10px; }
.complaint-card-row { display: flex; flex-direction: column; gap: 2px; }
.complaint-card-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.complaint-card-value { font-size: .925rem; font-weight: 500; word-break: break-word; }

@media (min-width: 640px) {
    .complaint-card-row { flex-direction: row; align-items: flex-start; gap: 12px; }
    .complaint-card-label { min-width: 110px; flex-shrink: 0; padding-top: 2px; }
    .complaint-card-value { flex: 1; }
}

@media (min-width: 900px) {
    .complaint-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination-info { font-size: .9rem; color: var(--text-muted); }

/* Complaint detail */
.complaint-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.complaint-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { font-size: .875rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; }
.back-link:hover { color: var(--primary); text-decoration: none; }

.complaint-layout { display: grid; gap: 22px; }

@media (min-width: 900px) {
    .complaint-layout { grid-template-columns: 1fr 340px; align-items: start; }
}

.complaint-sidebar .card .form-group { margin-bottom: 16px; }
.complaint-sidebar h3, .complaint-main h3 {
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-soft);
}

.card h3 {
    margin-bottom: 16px;
    font-weight: 700;
}

/* Comments */
.comments-list { margin-bottom: 20px; }

.comment-item {
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
}

.comment-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: .85rem;
}

.comment-date { color: var(--text-muted); margin-left: auto; font-size: .8rem; }
.comment-form textarea { width: 100%; margin-bottom: 0; }

/* Staff page */
.staff-page { display: flex; flex-direction: column; gap: 26px; }

.staff-unit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--primary-soft);
}

.staff-unit-header h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.staff-form .form-grid { margin-bottom: 18px; }

.password-cell { min-width: 130px; }
.password-display { display: inline-flex; align-items: center; gap: 6px; }

.password-value {
    font-family: 'Consolas', monospace;
    font-size: .85rem;
    background: var(--bg);
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.password-value.masked { color: var(--text-muted); }

.btn-toggle-password {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
}

.btn-toggle-password:hover { background: var(--primary-soft); color: var(--primary); }

.form-actions-inline { display: flex; gap: 10px; flex-wrap: wrap; }

.actions-cell { white-space: nowrap; min-width: 150px; }
.action-buttons { display: inline-flex; gap: 8px; align-items: center; }
.inline-form { display: inline-flex; margin: 0; }

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all .15s;
}

.btn-action:hover { text-decoration: none; transform: none; }
.btn-action svg { flex-shrink: 0; }
.btn-action-edit { background: var(--primary-soft); color: var(--primary-dark); border-color: #99f6e4; }
.btn-action-edit:hover { background: #ccfbf1; }
.btn-action-delete { background: #fff; color: #b91c1c; border-color: #fecaca; }
.btn-action-delete:hover { background: #fef2f2; }

.self-badge {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.text-sm { font-size: .85rem; }

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 28px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .875rem;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.footer-hotline {
    font-size: .95rem;
    color: var(--text);
    font-weight: 600;
}

.footer-hotline a {
    font-weight: 800;
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .btn-action { padding: 8px 12px; }
}
