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

:root {
    --bg: #f5f5f7;
    --card: rgba(255, 255, 255, 0.72);
    --card-solid: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(15, 23, 42, 0.08);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 20px 50px rgba(15, 23, 42, 0.08);
    --primary: #111827;
    --accent: #2563eb;
    --danger: #dc2626;
    --success: #059669;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.10), transparent 30%),
        radial-gradient(circle at top right, rgba(168,85,247,0.08), transparent 25%),
        linear-gradient(180deg, #f8fafc 0%, #f5f5f7 100%);
    color: var(--text);
    min-height: 100vh;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 28px 22px;
}

.brand-block {
    text-align: center;
    margin-bottom: 26px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
}

.brand-title {
    font-size: clamp(32px, 6vw, 42px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}

.brand-subtitle {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-control {
    width: 100%;
    height: 52px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    background: rgba(255,255,255,0.92);
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: rgba(37,99,235,0.35);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.10);
}

.btn {
    width: 100%;
    border: none;
    border-radius: 18px;
    min-height: 54px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.14);
    color: #991b1b;
}

.alert-success {
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.14);
    color: #065f46;
}

.vv-footer {
    text-align: center;
    padding: 12px 20px 96px;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-shell {
    min-height: 100vh;
    padding: 18px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    background: rgba(255,255,255,0.72);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 16px 18px;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.topbar-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.topbar-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.user-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}

.dashboard-card {
    background: rgba(255,255,255,0.78);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
}

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

.metric-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
}

.metric-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.metric-value {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.metric-meta {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

.logout-link {
    text-decoration: none;
    color: #111827;
    font-weight: 600;
    font-size: 14px;
}

@media (min-width: 768px) {
    .dashboard-shell {
        padding: 24px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .auth-card {
        padding: 34px 30px;
    }
}


.executive-mode {
    position: relative;
}

.executive-mode::after {
    content: "Restricted View • LogBook • Virag Vigyan";
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 5vw, 42px);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(17, 24, 39, 0.05);
    pointer-events: none;
    transform: rotate(-24deg);
    z-index: 0;
}

.executive-mode > * {
    position: relative;
    z-index: 1;
}

.geo-note {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--muted);
}

.geo-note[data-state="success"] {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.14);
    color: #065f46;
}

.geo-note[data-state="error"] {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.14);
    color: #991b1b;
}

.app-shell {
    min-height: 100vh;
    padding: 18px 18px 110px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.app-topbar {
    border-radius: 26px;
    padding: 18px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-page-kicker {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 12px;
}

.app-page-title {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    font-weight: 700;
    margin-bottom: 6px;
}

.app-page-subtitle {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.app-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 10px 14px;
    border-radius: 999px;
}

.app-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.app-user-role {
    font-size: 12px;
    color: var(--muted);
}

.app-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
}

.hero-panel {
    border-radius: 30px;
    padding: 24px 20px;
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}

.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.14), transparent 35%),
        radial-gradient(circle at bottom right, rgba(168,85,247,0.10), transparent 32%);
    pointer-events: none;
}

.hero-panel-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(28px, 8vw, 44px);
    line-height: 1.03;
    letter-spacing: -0.05em;
    font-weight: 700;
    max-width: 760px;
    margin-bottom: 12px;
}

.hero-text {
    font-size: 15px;
    line-height: 1.75;
    color: var(--muted);
    max-width: 760px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.premium-card {
    border-radius: 24px;
    background: rgba(255,255,255,0.90);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.module-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.module-card {
    border-radius: 26px;
    padding: 20px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.08);
}

.module-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.90);
    border: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 24px;
    margin-bottom: 16px;
}

.module-title {
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -0.035em;
    font-weight: 700;
    margin-bottom: 10px;
}

.module-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 16px;
}

.module-link {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.mobile-nav-item {
    min-height: 58px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    transition: all 0.18s ease;
}

.mobile-nav-item.active {
    background: rgba(17, 24, 39, 0.94);
    color: #fff;
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.18);
}

.mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
}

.mobile-nav-label {
    line-height: 1;
}

@media (min-width: 768px) {
    .app-shell {
        padding: 24px 24px 36px;
    }

    .app-topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-bottom-nav {
        display: none;
    }
}

@media (min-width: 1200px) {
    .module-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .vv-footer {
        padding-bottom: 28px;
    }
}

.page-actions-bar {
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.records-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.record-card {
    border-radius: 24px;
    padding: 20px;
}

.record-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.record-code {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.record-title {
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.record-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.record-meta-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.record-meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.empty-state {
    border-radius: 28px;
    padding: 26px 22px;
    text-align: center;
}

.empty-state h3 {
    font-size: 22px;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 14px;
}

.form-shell {
    border-radius: 30px;
    padding: 24px 20px;
}

.form-title {
    font-size: clamp(28px, 7vw, 38px);
    line-height: 1.05;
    letter-spacing: -0.045em;
    font-weight: 700;
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 22px;
    max-width: 760px;
}

.modern-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    padding-top: 14px;
    padding-bottom: 14px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255,255,255,0.9);
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

@media (min-width: 768px) {
    .page-actions-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .records-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .secondary-btn,
    .form-actions .btn {
        width: auto;
        min-width: 160px;
    }
}

@media (min-width: 1200px) {
    .records-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

.record-card-link:hover .record-title {
    opacity: 0.88;
}

.status-inline {
    vertical-align: middle;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.detail-card {
    border-radius: 28px;
    padding: 22px 20px;
}

.detail-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 13px;
    color: var(--muted);
    min-width: 120px;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

.timeline-section {
    border-radius: 30px;
    padding: 22px 20px;
}

.timeline-list {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 14px;
    align-items: flex-start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #111827;
    margin-top: 10px;
    box-shadow: 0 0 0 6px rgba(17, 24, 39, 0.06);
}

.timeline-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 22px;
    padding: 16px;
}

.timeline-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.timeline-status-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-old-status {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.timeline-arrow {
    color: var(--muted);
    font-size: 13px;
}

.timeline-time {
    font-size: 12px;
    color: var(--muted);
}

.timeline-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.timeline-remarks {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.empty-inline {
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.status-discarded {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.status-pill.status-progress {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.status-pill.status-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.status-pill.status-paused {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

@media (min-width: 768px) {
    .details-grid {
        grid-template-columns: 1.1fr 1fr;
    }
}

.ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ai-generate-btn {
    border: none;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.14);
}

.ai-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-helper-text {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.ai-helper-text[data-state="success"] {
    color: #065f46;
}

.ai-helper-text[data-state="error"] {
    color: #991b1b;
}

.ai-helper-text[data-state="loading"] {
    color: #1d4ed8;
}

.shimmer-box {
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
    position: relative;
}

.shimmer-line {
    height: 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    background: linear-gradient(
        90deg,
        rgba(226, 232, 240, 0.9) 25%,
        rgba(248, 250, 252, 1) 50%,
        rgba(226, 232, 240, 0.9) 75%
    );
    background-size: 200% 100%;
    animation: shimmerMove 1.2s infinite linear;
}

.shimmer-line:last-child {
    margin-bottom: 0;
}

.shimmer-line-lg {
    width: 100%;
}

.shimmer-line-md {
    width: 72%;
}

@keyframes shimmerMove {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.filter-shell {
    border-radius: 28px;
    padding: 22px 20px;
    margin-bottom: 18px;
}

.task-preview-text {
    font-weight: 500;
    line-height: 1.7;
    color: var(--text);
}

.restricted-screen {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.executive-mode::after {
    content: "Restricted View • Executive • LogBook • Virag Vigyan";
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(22px, 5vw, 44px);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(17, 24, 39, 0.06);
    pointer-events: none;
    transform: rotate(-24deg);
    z-index: 0;
}