/* ============================================
   Karvi Control Panel v1.0.0 — LOCKED
   Premium Black & White Theme
   ============================================ */

:root {
    --black: #000000;
    --black-soft: #111111;
    --black-card: #161616;
    --black-hover: #1c1c1c;
    --white: #ffffff;
    --white-soft: #f5f5f5;
    --gray-100: #e8e8e8;
    --gray-200: #c4c4c4;
    --gray-300: #8a8a8a;
    --gray-400: #5a5a5a;
    --accent: #ffffff;
    --accent-dim: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.login-bg-pattern {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 0;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    padding: 24px;
}

.login-card {
    background: var(--black-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--accent-dim);
}

.brand-icon svg {
    width: 28px;
    height: 28px;
    color: var(--white);
}

.login-brand h1 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 6px;
}

.brand-subtitle {
    font-size: 0.875rem;
    color: var(--gray-300);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-200);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    background: var(--black);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--white);
    font-family: var(--font-sans);
    font-size: max(16px, 0.95rem);
    transition: var(--transition);
    outline: none;
    min-height: 48px;
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.input-wrapper input:focus {
    border-color: var(--border-hover);
    background: var(--black-card);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--gray-200);
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: var(--gray-400);
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--gray-200);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.error-message {
    background: rgba(255, 60, 60, 0.08);
    border: 1px solid rgba(255, 60, 60, 0.2);
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    text-align: center;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    min-height: 48px;
    background: var(--white);
    color: var(--black);
    border: none;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: max(16px, 0.95rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
    -webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
    background: var(--white-soft);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login svg {
    width: 18px;
    height: 18px;
    transition: var(--transition);
}

.btn-login:hover svg {
    transform: translateX(3px);
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--gray-400);
    letter-spacing: 0.02em;
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */

.dashboard-page {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.dashboard-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 255, 255, 0.04) 0%, transparent 60%),
        #000000;
    z-index: 0;
}

.dashboard-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.dashboard-glow-1 {
    width: 500px;
    height: 500px;
    top: -120px;
    left: -80px;
    background: rgba(255, 255, 255, 0.03);
}

.dashboard-glow-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -60px;
    background: rgba(255, 255, 255, 0.025);
}

.dashboard-noise {
    position: fixed;
    inset: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.dashboard-main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px clamp(16px, 4vw, 36px) max(80px, calc(20px + env(safe-area-inset-bottom)));
    padding-left: max(clamp(16px, 4vw, 36px), env(safe-area-inset-left));
    padding-right: max(clamp(16px, 4vw, 36px), env(safe-area-inset-right));
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.download-toast {
    position: fixed;
    bottom: max(32px, calc(16px + env(safe-area-inset-bottom)));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    animation: toastIn 0.3s ease;
    width: calc(100% - 32px);
    max-width: 360px;
}

.download-toast-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: #111111;
    border: 1px solid #333333;
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.download-toast-inner svg {
    width: 18px;
    height: 18px;
    animation: bounceDown 1s ease infinite;
}

.download-frame {
    position: fixed;
    width: 0;
    height: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ============================================
   DOWNLOAD STATUS PAGE
   ============================================ */

.status-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.status-bg {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 0;
}

.status-main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(480px, 100%);
    padding: clamp(16px, 4vw, 24px);
}

.status-card {
    background: #0c0c0c;
    border: 1px solid #222222;
    border-radius: 20px;
    padding: 40px 36px;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.status-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid #2a2a2a;
    background: #141414;
}

.status-icon svg {
    width: 32px;
    height: 32px;
}

.status-icon-missing {
    color: rgba(255, 255, 255, 0.7);
}

.status-icon-error {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.25);
    background: rgba(255, 107, 107, 0.06);
}

.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid #2a2a2a;
    margin-bottom: 16px;
}

.status-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.status-file {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 16px;
    font-family: monospace;
}

.status-message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 32px;
}

.status-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    min-height: 48px;
    border-radius: 12px;
    font-size: max(15px, 0.875rem);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.status-btn svg {
    width: 16px;
    height: 16px;
}

.status-btn-primary {
    background: #ffffff;
    color: #000000;
    border: 1px solid #ffffff;
}

.status-btn-primary:hover {
    background: #e8e8e8;
}

.status-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid #333333;
}

.status-btn-secondary:hover {
    border-color: #555555;
    color: #ffffff;
}

@media (max-width: 480px) {
    .status-card {
        padding: 28px 20px;
    }

    .status-title {
        font-size: 1.15rem;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(12px, 2.5vw, 18px);
    width: 100%;
    max-width: 100%;
}

.dashboard-card {
    color: inherit;
    display: block;
    height: 100%;
    min-width: 0;
}

.card-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 40%, transparent 100%),
                #0e0e0e;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease;
}

.card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 0;
}

.card-index {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.25);
    font-variant-numeric: tabular-nums;
}

.card-tag {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: 3px 8px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4px 14px 10px;
    flex: 1;
}

.card-corner-icon {
    position: absolute;
    top: 0;
    right: 14px;
    width: 18px;
    height: 18px;
    opacity: 0.25;
}

.card-corner-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.card-icon-box {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 4px 0 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.35s ease;
}

.card-icon-ring {
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.card-icon-box img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    border-radius: 13px;
}

.card-title {
    font-family: var(--font-display);
    font-size: clamp(0.82rem, 1.8vw, 0.95rem);
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card-desc {
    font-size: clamp(0.65rem, 1.5vw, 0.72rem);
    color: rgba(255, 255, 255, 0.38);
    line-height: 1.45;
    margin: 0;
    max-width: 100%;
    width: 100%;
    overflow-wrap: anywhere;
}

.card-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
}

.card-actions-dual {
    gap: 8px;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    min-height: 40px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    font-size: clamp(0.58rem, 1.4vw, 0.66rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease,
                transform 0.3s ease, box-shadow 0.3s ease;
    white-space: normal;
    text-align: center;
    width: 100%;
    min-width: 0;
    -webkit-tap-highlight-color: transparent;
}

.card-actions-dual .card-btn {
    flex: 1 1 0;
    padding: 8px 6px;
}

.card-actions-dual .card-btn span {
    overflow-wrap: anywhere;
}

.card-btn-icon {
    width: 12px;
    height: 12px;
    opacity: 0.7;
    flex-shrink: 0;
}

.card-btn-arrow {
    width: 12px;
    height: 12px;
    margin-left: auto;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
}

.card-actions-dual .card-btn-arrow {
    display: none;
}

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

.card-btn:active {
    transform: scale(0.98);
}

.card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
    .dashboard-card:hover .card-inner {
        border-color: rgba(255, 255, 255, 0.16);
        transform: translateY(-5px);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
    }

    .dashboard-card:hover .card-inner::before,
    .dashboard-card:hover .card-shine {
        opacity: 1;
    }

    .dashboard-card:hover .card-icon-box {
        transform: scale(1.06);
    }

    .dashboard-card:hover .card-icon-ring {
        border-color: rgba(255, 255, 255, 0.28);
        box-shadow: 0 0 24px rgba(255, 255, 255, 0.06);
    }

    .dashboard-card:hover .card-tag {
        background: #ffffff;
        color: #000000;
        border-color: #ffffff;
    }

    .card-btn:hover {
        background: #ffffff;
        color: #000000;
        border-color: #ffffff;
        box-shadow: 0 4px 20px rgba(255, 255, 255, 0.12);
        transform: translateY(-1px);
    }

    .card-btn:hover .card-btn-icon {
        opacity: 1;
    }

    .card-btn:hover .card-btn-arrow {
        opacity: 1;
        transform: translateX(3px);
    }

    .logout-fab:hover {
        background: #ffffff;
        border-color: #ffffff;
        color: #000000;
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

.logout-fab {
    position: fixed;
    bottom: max(28px, calc(12px + env(safe-area-inset-bottom)));
    right: max(28px, calc(12px + env(safe-area-inset-right)));
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c0c0c;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: var(--transition);
    z-index: 10;
}

.logout-fab:active {
    transform: scale(0.96);
}

.logout-fab svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeInUp 0.6s ease-out;
}

.dashboard-card {
    animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dashboard-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-card:nth-child(2) { animation-delay: 0.08s; }
.dashboard-card:nth-child(3) { animation-delay: 0.11s; }
.dashboard-card:nth-child(4) { animation-delay: 0.14s; }
.dashboard-card:nth-child(5) { animation-delay: 0.17s; }
.dashboard-card:nth-child(6) { animation-delay: 0.20s; }
.dashboard-card:nth-child(7) { animation-delay: 0.23s; }
.dashboard-card:nth-child(8) { animation-delay: 0.26s; }

/* ============================================
   RESPONSIVE — all devices
   ============================================ */

/* Force 3 columns on large desktops */
@media (min-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablets: 2 columns */
@media (min-width: 600px) and (max-width: 1099px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phones: 1 column */
@media (max-width: 599px) {
    .login-page {
        align-items: flex-start;
        padding-top: max(20px, env(safe-area-inset-top));
    }

    .login-container {
        padding: 12px;
        max-width: 100%;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .login-brand {
        margin-bottom: 28px;
    }

    .brand-icon {
        width: 48px;
        height: 48px;
    }

    .login-form {
        gap: 20px;
    }

    .dashboard-main {
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(88px, calc(24px + env(safe-area-inset-bottom)));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card-meta {
        padding: 8px 12px 0;
    }

    .card-body {
        padding: 4px 12px 10px;
    }

    .card-icon-box {
        width: clamp(64px, 18vw, 80px);
        height: clamp(64px, 18vw, 80px);
    }

    .card-actions {
        padding: 8px 12px 10px;
    }

    .card-btn {
        min-height: 44px;
        font-size: 0.64rem;
    }

    .card-actions-dual {
        flex-direction: column;
        gap: 8px;
    }

    .card-actions-dual .card-btn {
        width: 100%;
    }

    .card-btn-arrow {
        display: none;
    }

    .logout-fab {
        width: 44px;
        height: 44px;
        bottom: max(16px, calc(12px + env(safe-area-inset-bottom)));
        right: max(16px, calc(12px + env(safe-area-inset-right)));
    }

    .status-main {
        padding: 12px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .status-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .status-title {
        font-size: 1.15rem;
    }

    .status-message {
        font-size: 0.85rem;
    }

    .status-file {
        overflow-wrap: anywhere;
        word-break: break-word;
        font-size: 0.75rem;
    }

    .download-toast {
        width: calc(100% - 24px);
    }

    .download-toast-inner {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
        padding: 12px 16px;
    }
}

/* Tablets shared (600px+) */
@media (min-width: 600px) and (max-width: 1099px) {
    .login-container {
        padding: 16px;
        max-width: 100%;
    }

    .login-card {
        padding: 36px 28px;
    }

    .dashboard-main {
        padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: max(80px, calc(20px + env(safe-area-inset-bottom)));
    }

    .card-btn-arrow {
        display: none;
    }

    .logout-fab {
        bottom: max(20px, calc(12px + env(safe-area-inset-bottom)));
        right: max(20px, calc(12px + env(safe-area-inset-right)));
    }

    .status-main {
        padding: 16px;
    }

    .status-card {
        padding: 32px 24px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .card-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .card-tag {
        font-size: 0.55rem;
        padding: 3px 7px;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .login-card {
        padding: 24px 16px;
    }
}

/* Landscape phones & short screens */
@media (max-height: 500px) and (orientation: landscape) {
    .login-page {
        align-items: flex-start;
        padding: 12px;
    }

    .login-card {
        padding: 20px 18px;
    }

    .login-brand {
        margin-bottom: 16px;
    }

    .login-brand h1 {
        font-size: 1.25rem;
    }

    .dashboard-main {
        padding-top: 16px;
        padding-bottom: 72px;
    }
}

/* Large desktops */
@media (min-width: 1400px) {
    .dashboard-main {
        max-width: 1320px;
    }

    .dashboard-grid {
        gap: 20px;
    }
}

/* Touch devices — larger tap targets */
@media (pointer: coarse) {
    .card-btn {
        min-height: 44px;
    }

    .toggle-password {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .logout-fab {
        width: 48px;
        height: 48px;
    }
}
