/* ============================================================
   Premium Property Management — Dark Theme Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Dark palette */
    --bg-primary:    #0a0e1a;
    --bg-secondary:  #131832;
    --bg-card:       rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input:      rgba(255, 255, 255, 0.06);
    --bg-sidebar:    rgba(10, 14, 30, 0.95);

    /* Borders */
    --border:        rgba(255, 255, 255, 0.08);
    --border-hover:  rgba(255, 255, 255, 0.15);
    --border-focus:  rgba(59, 130, 246, 0.5);

    /* Text */
    --text:          #e2e8f0;
    --text-muted:    #94a3b8;
    --text-dim:      #64748b;
    --text-bright:   #f8fafc;

    /* Accent colors */
    --blue:          #3b82f6;
    --blue-dark:     #2563eb;
    --blue-glow:     rgba(59, 130, 246, 0.25);
    --emerald:       #10b981;
    --emerald-dark:  #059669;
    --emerald-glow:  rgba(16, 185, 129, 0.25);
    --amber:         #f59e0b;
    --amber-dark:    #d97706;
    --amber-glow:    rgba(245, 158, 11, 0.25);
    --rose:          #ef4444;
    --rose-dark:     #dc2626;
    --rose-glow:     rgba(239, 68, 68, 0.25);
    --purple:        #8b5cf6;
    --purple-glow:   rgba(139, 92, 246, 0.25);

    /* Shadows */
    --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg:   0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue:    0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.3);
    --shadow-glow-amber:   0 0 20px rgba(245, 158, 11, 0.3);
    --shadow-glow-rose:    0 0 20px rgba(239, 68, 68, 0.3);

    /* Radii */
    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.25s;

    /* Layout */
    --sidebar-width: 240px;
    --topbar-height: 60px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ============ BODY & BACKGROUND ============ */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, #0d1228 100%);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 600px 600px at 10% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 90%, rgba(16, 185, 129, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

a:hover {
    color: #60a5fa;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(10px, -20px) rotate(5deg); }
    50%      { transform: translate(-5px, -35px) rotate(-3deg); }
    75%      { transform: translate(-15px, -15px) rotate(4deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.4); }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(59, 130, 246, 0.3); }
    50%      { border-color: rgba(59, 130, 246, 0.6); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============ TOPBAR (mobile) ============ */
.topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: rgba(10, 14, 30, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1100;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.topbar-brand {
    color: var(--text-bright);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.topbar-brand:hover {
    color: var(--text-bright);
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--duration) var(--ease);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s var(--ease);
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    font-size: 2rem;
    line-height: 1;
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
    position: relative;
}

.sidebar-link:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
    color: var(--blue);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--blue);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

.sidebar-link--logout {
    color: var(--text-dim);
}

.sidebar-link--logout:hover {
    color: var(--rose);
    background: rgba(239, 68, 68, 0.08);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.4s var(--ease);
    min-height: calc(100vh - 60px);
    max-width: 1200px;
}

.main-content--full {
    margin-left: 0;
    max-width: 100%;
}

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    margin-left: var(--sidebar-width);
    position: relative;
    z-index: 1;
}

.main-content--full ~ .footer {
    margin-left: 0;
}

/* ============ PAGE HEADER ============ */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-bright);
    margin: 0 0 0.25rem;
    letter-spacing: -0.03em;
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--blue);
    margin-bottom: 0.75rem;
    transition: all var(--duration) var(--ease);
}

.back-link:hover {
    color: #60a5fa;
    gap: 0.5rem;
}

/* ============ TOOLBAR ============ */
.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.05), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.card--link:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px var(--blue-glow);
    color: inherit;
    background: var(--bg-card-hover);
}

/* Status borders */
.card--status-green {
    border-left: 4px solid var(--emerald);
    box-shadow: inset 4px 0 12px -4px var(--emerald-glow);
}

.card--status-amber {
    border-left: 4px solid var(--amber);
    box-shadow: inset 4px 0 12px -4px var(--amber-glow);
}

.card--status-red {
    border-left: 4px solid var(--rose);
    box-shadow: inset 4px 0 12px -4px var(--rose-glow);
}

.card--status-green:hover {
    box-shadow: inset 4px 0 12px -4px var(--emerald-glow), 0 8px 30px rgba(0,0,0,0.3), var(--shadow-glow-emerald);
}

.card--status-amber:hover {
    box-shadow: inset 4px 0 12px -4px var(--amber-glow), 0 8px 30px rgba(0,0,0,0.3), var(--shadow-glow-amber);
}

.card--status-red:hover {
    box-shadow: inset 4px 0 12px -4px var(--rose-glow), 0 8px 30px rgba(0,0,0,0.3), var(--shadow-glow-rose);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-bright);
}

.card-badge {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.card-body {
    /* container for card content */
}

.card-footer {
    text-align: right;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--text-bright);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.cards-grid .card {
    margin-bottom: 0;
}

/* ============ FORM CARD ============ */
.form-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
}

/* ============ SECTION ============ */
.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    text-decoration: none;
    text-align: center;
    transition: all var(--duration) var(--ease);
    line-height: 1.4;
    letter-spacing: 0.01em;
    font-family: inherit;
    position: relative;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn--primary:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    color: #fff;
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.3);
}

.btn--danger {
    background: linear-gradient(135deg, var(--rose), var(--rose-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn--danger:hover {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    color: #fff;
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn--success {
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn--success:hover {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    color: #fff;
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn--outline {
    background: transparent;
    border: 1.5px solid var(--border-hover);
    color: var(--text);
}

.btn--outline:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 0 12px var(--blue-glow);
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
}

.btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn--lg {
    padding: 0.9rem 1.8rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn--full {
    width: 100%;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    color: var(--text);
}

.form-input,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 0;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
    background: var(--bg-input);
    color: var(--text);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow), 0 0 15px var(--blue-glow);
    background: rgba(255, 255, 255, 0.08);
}

select {
    cursor: pointer;
}

select option {
    background: var(--bg-secondary);
    color: var(--text);
}

.form-input--sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.required {
    color: var(--rose);
}

.inline-form {
    display: inline;
}

.form--inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ============ TABLES ============ */
.table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.03);
}

.table tbody tr {
    transition: all var(--duration) var(--ease);
}

.table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============ STATUS BADGES ============ */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status--ok {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald);
}

.status--ok::before {
    background: var(--emerald);
    box-shadow: 0 0 6px var(--emerald-glow);
    animation: pulse 2s infinite;
}

.status--pending {
    background: rgba(239, 68, 68, 0.12);
    color: var(--rose);
}

.status--pending::before {
    background: var(--rose);
    box-shadow: 0 0 6px var(--rose-glow);
}

.status--warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--amber);
}

.status--warning::before {
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber-glow);
    animation: pulse 2s infinite;
}

/* ============ METER TYPE BUTTONS ============ */
.meter-type-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.meter-type-btn {
    flex: 1;
    min-width: 110px;
    cursor: pointer;
}

.meter-type-btn input[type="radio"] {
    display: none;
}

.meter-type-btn-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: all var(--duration) var(--ease);
    background: var(--bg-card);
    cursor: pointer;
}

.meter-type-btn-label .icon {
    font-size: 2.5rem;
    line-height: 1;
}

.meter-type-btn input[type="radio"]:checked + .meter-type-btn-label {
    border-color: var(--blue);
    background: rgba(59, 130, 246, 0.08);
    color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow), var(--shadow-glow-blue);
}

.meter-type-btn-label:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.04);
    color: var(--text);
}

/* ============ PHOTO UPLOAD ============ */
.photo-upload {
    position: relative;
    cursor: pointer;
}

.photo-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
    z-index: 2;
}

.photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.5rem;
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    transition: all 0.3s var(--ease);
}

.photo-upload:hover .photo-upload-placeholder {
    border-color: var(--blue);
    color: var(--blue);
    background: rgba(59, 130, 246, 0.04);
    box-shadow: 0 0 20px var(--blue-glow);
}

.photo-upload-icon {
    font-size: 2.5rem;
}

.photo-upload-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.photo-preview {
    max-width: 240px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-top: 0.75rem;
}

/* ============ METER STATUS LIST ============ */
.meter-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meter-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
}

.meter-name {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============ BILLING ============ */
.billing-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.billing-row:last-child {
    border-bottom: none;
}

.billing-meter-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-bright);
}

.billing-calc {
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.billing-calc strong {
    color: var(--blue);
}

.bill-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--blue);
}

.grand-total {
    background: linear-gradient(135deg, var(--blue), var(--purple), var(--blue));
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(59, 130, 246, 0.2);
    letter-spacing: -0.01em;
}

.grand-total strong {
    font-size: 1.6rem;
    font-weight: 800;
    display: block;
    margin-top: 0.3rem;
}

/* ============ INVITE LINK ============ */
.invite-link-wrap {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.invite-input {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.5rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    min-width: 180px;
    margin-bottom: 0 !important;
}

.copy-btn {
    white-space: nowrap;
}

/* ============ ALERTS ============ */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    border-left: 4px solid;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-card);
}

.alert--warning {
    border-color: var(--amber);
    color: var(--amber);
}

.alert--error {
    border-color: var(--rose);
    color: var(--rose);
}

.alert--success {
    border-color: var(--emerald);
    color: var(--emerald);
}

/* ============ AUTH PAGE ============ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #0a0e1a 0%, #131832 40%, #1a1040 70%, #0d1228 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 500px 500px at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 70% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.auth-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
}

.shape--1 {
    width: 300px;
    height: 300px;
    background: var(--blue);
    top: -80px;
    right: -60px;
    animation: float 12s ease-in-out infinite;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.shape--2 {
    width: 200px;
    height: 200px;
    background: var(--purple);
    bottom: 10%;
    left: 5%;
    animation: float 15s ease-in-out infinite reverse;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

.shape--3 {
    width: 150px;
    height: 150px;
    background: var(--emerald);
    top: 40%;
    right: 15%;
    animation: float 10s ease-in-out infinite 2s;
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
}

.shape--4 {
    width: 100px;
    height: 100px;
    background: var(--amber);
    top: 15%;
    left: 20%;
    animation: float 18s ease-in-out infinite 1s;
    border-radius: 50% 50% 30% 70% / 50% 70% 30% 50%;
}

.shape--5 {
    width: 250px;
    height: 250px;
    background: var(--rose);
    bottom: -50px;
    right: 30%;
    animation: float 14s ease-in-out infinite 3s;
    border-radius: 70% 30% 50% 50% / 30% 50% 50% 70%;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(59, 130, 246, 0.08);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    animation: fadeIn 0.6s var(--ease);
}

.auth-icon {
    text-align: center;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.auth-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-bright);
    margin: 0 0 0.35rem;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin: 0 0 2rem;
    font-size: 0.9rem;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

/* ============ MONTH SELECTOR ============ */
.month-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.month-selector select,
.month-selector input {
    width: auto;
    margin-bottom: 0;
}

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-right  { text-align: right; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* ============ RESPONSIVE — 768px ============ */
@media (max-width: 768px) {
    .topbar {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: -100%;
        width: 280px;
        height: calc(100vh - var(--topbar-height));
        transition: left 0.3s var(--ease);
        z-index: 1050;
        border-right: 1px solid var(--border);
        background: rgba(10, 14, 30, 0.98);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-brand {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem 1rem;
        padding-top: calc(var(--topbar-height) + 1.25rem);
    }

    .footer {
        margin-left: 0;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table th,
    .table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.825rem;
    }

    .meter-type-buttons {
        flex-direction: column;
    }

    .meter-type-btn {
        min-width: auto;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .invite-link-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .invite-input {
        min-width: auto !important;
    }

    .btn--full-mobile {
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
    }

    .toolbar .form--inline {
        width: 100%;
    }

    .grand-total {
        padding: 1.25rem 1rem;
        font-size: 1rem;
    }

    .grand-total strong {
        font-size: 1.25rem;
    }
}

/* ============ RESPONSIVE — 480px ============ */
@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.75rem;
        padding-top: calc(var(--topbar-height) + 1rem);
    }

    .card {
        padding: 1.125rem;
    }

    .form-card {
        padding: 1.25rem;
    }

    .photo-upload-placeholder {
        padding: 1.75rem;
    }
}
