/* Global Reset & Variables */
:root {
    --bg-dark: #080C14;
    --card-bg: rgba(17, 25, 40, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --secondary: #10B981;
    --secondary-hover: #059669;
    --accent-blue: #3B82F6;
    --accent-purple: #8B5CF6;
    --accent-gold: #F59E0B;
    --danger: #EF4444;
    
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Light Blobs (Glassmorphism Effect) */
.glass-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    top: -200px;
    left: -150px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
    animation: pulse 12s infinite alternate;
}

.glass-bg-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
    animation: pulse 15s infinite alternate-reverse;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(50px, 30px); }
}

/* Container & Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    backdrop-filter: blur(4px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(10, 15, 30, 0.8);
    border-right: 1px solid var(--card-border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.brand h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF 30%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 24px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 18px;
}

.nav-item:hover, .nav-item.active {
    color: #FFF;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-left: 3px solid var(--primary);
    border-radius: 4px 12px 12px 4px;
}

.system-status-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background-color: var(--secondary);
    box-shadow: 0 0 8px var(--secondary);
}

.status-indicator.offline {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.status-detail p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-green {
    color: var(--secondary);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    max-height: 100vh;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 5px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: 30px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
}

.profile-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* View Sections */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

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

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.bg-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.stat-icon.bg-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-icon.bg-gold {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
}

.stat-data h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-data .val {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 5px 0;
}

.stat-data .desc {
    font-size: 12px;
    color: var(--text-dim);
}

.session-status.valid {
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.session-status.invalid {
    color: var(--danger);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Dashboard Row (Split view) */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

/* General Cards style */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    overflow: hidden;
}

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

.card-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* Action Card */
.action-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.info-text {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    color: #FFF;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 5px 10px;
    font-size: 14px;
}

.btn-text:hover {
    color: #FFF;
}

.status-msg {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-msg.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93C5FD;
}

.status-msg.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #A7F3D0;
}

.status-msg.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

.hide {
    display: none !important;
}

/* Schedule Card (Timeline) */
.schedule-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 20px 0;
}

.schedule-timeline::before {
    content: '';
    position: absolute;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    width: 80%;
    top: 50%;
    left: 10%;
    z-index: 1;
}

.timeline-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
    width: 25%;
}

.slot-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.slot-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1F2937;
    border: 3px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
}

.timeline-slot.done .slot-marker {
    background: var(--secondary);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px var(--secondary);
}

.timeline-slot.failed .slot-marker {
    background: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px var(--danger);
}

.timeline-slot.active .slot-marker {
    background: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 10px var(--primary);
    transform: scale(1.2);
}

.slot-status {
    font-size: 12px;
    color: var(--text-dim);
}

.timeline-slot.done .slot-status {
    color: var(--secondary);
    font-weight: 500;
}

.timeline-slot.failed .slot-status {
    color: var(--danger);
    font-weight: 500;
}

.timeline-slot.active .slot-status {
    color: var(--primary);
    font-weight: 600;
}

/* Recent Posts Table */
.recent-posts-card {
    margin-top: 10px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.posts-table th {
    padding: 15px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
}

.posts-table td {
    padding: 18px 20px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.posts-table tbody tr {
    transition: var(--transition-smooth);
}

.posts-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.post-badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.post-badge.posted {
    background: rgba(16, 185, 129, 0.1);
    color: #34D399;
}

.post-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #F87171;
}

.post-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #FBBF24;
}

.link-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.link-btn:hover {
    text-decoration: underline;
    color: #FFF;
}

/* History View Styles */
.history-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 25px;
    height: calc(100vh - 200px);
}

@media (max-width: 900px) {
    .history-container {
        grid-template-columns: 1fr;
    }
}

.history-list-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.posts-list-group {
    overflow-y: auto;
    flex-grow: 1;
}

.history-item {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.history-item:hover, .history-item.active {
    background: rgba(255, 255, 255, 0.03);
}

.history-item.active {
    border-left: 3px solid var(--primary);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.history-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-detail-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-badge {
    font-size: 12px;
}

.detail-content-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 30px !important;
}

.empty-detail-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    gap: 15px;
}

.empty-detail-state i {
    font-size: 40px;
}

.post-view-title {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #FFF;
}

.post-view-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
}

.meta-item i {
    margin-right: 5px;
}

.post-view-body {
    font-size: 15px;
    line-height: 1.8;
    color: #D1D5DB;
    margin-bottom: 40px;
}

/* Paragraph spacing */
.post-view-body p {
    margin-bottom: 15px;
}

.post-view-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.post-view-block h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-view-block p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 0;
}

/* Settings View Styles */
.settings-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 25px;
}

@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.session-info-large {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    margin-bottom: 20px;
}

.session-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.session-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.session-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.session-path-info {
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-dim);
}

.session-path-info code {
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 6px;
    border-radius: 4px;
    color: #F3F4F6;
    font-family: monospace;
}

.card-divider {
    border: none;
    height: 1px;
    background: var(--card-border);
    margin: 25px 0;
}

.settings-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.form-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-input label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-input input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: 10px;
    color: #FFF;
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.guide-steps {
    padding-left: 20px;
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.guide-steps li {
    margin-bottom: 8px;
}

.env-status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.env-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.env-key {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-muted);
}

.env-val {
    font-size: 13px;
    font-weight: 600;
}

.env-val.loaded {
    color: var(--secondary);
}

.env-val.missing {
    color: var(--danger);
}

.alert-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #93C5FD;
}

.alert-box i {
    font-size: 16px;
    margin-top: 2px;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }

/* Mobile Top Bar Style */
.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(8, 12, 20, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.mobile-top-bar .brand {
    display: flex;
    align-items: center;
    gap: 8px !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
}

.mobile-top-bar .brand h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF 30%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.system-status-box-mobile {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 20px;
}

/* Bottom Navigation Bar Style */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 15px; /* Float slightly above the bottom */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px); /* Side margins for floating look */
    max-width: 500px; /* Limit stretch on tablets & Fold 5 unfolded */
    height: 60px;
    background: rgba(13, 20, 35, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 30px; /* Pill shape */
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    flex: 1;
    height: 100%;
    transition: var(--transition-smooth);
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
    color: #FFF;
}

.bottom-nav-item.active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

/* Responsive Rules for Fold 5 (Folded/Mobile screens) and Unfolded Screens */
@media (max-width: 992px) {
    .mobile-top-bar {
        display: flex;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    .sidebar {
        display: none !important;
    }
    
    .app-container {
        display: block; /* Stack sidebar and content */
    }
    
    .main-content {
        padding: 80px 15px 95px 15px !important; /* Margins for fixed header/footer */
        max-height: none; /* Auto scroll */
        overflow-y: visible;
    }
    
    .main-header {
        display: none !important; /* Hide desktop header */
    }
}

/* Tablet & Galaxy Fold 5 Unfolded Viewport (768px to 992px) */
@media (min-width: 768px) and (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px;
    }
    
    .history-container {
        display: grid !important;
        grid-template-columns: 280px 1fr !important;
        gap: 20px;
        height: calc(100vh - 210px);
    }
    
    .history-list-panel {
        display: flex !important;
    }
    
    .history-detail-panel {
        display: flex !important;
    }
    
    .mobile-back-btn {
        display: none !important;
    }
    
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* Mobile & Galaxy Fold 5 Folded Viewport (< 768px) */
@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .form-group-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    /* Timeline optimization for vertical narrow screens */
    .schedule-timeline {
        flex-direction: column;
        gap: 20px;
        padding-left: 15px;
    }
    
    .schedule-timeline::before {
        width: 2px;
        height: 80%;
        left: 22px;
        top: 10%;
    }
    
    .timeline-slot {
        flex-direction: row;
        width: 100%;
        gap: 15px;
        justify-content: flex-start;
        align-items: center;
    }
    
    .slot-marker {
        margin-left: 0;
    }
    
    /* Mobile History List-Detail Switching */
    .history-container {
        grid-template-columns: 1fr !important;
        height: calc(100vh - 195px);
    }
    
    .history-list-panel {
        display: block;
        height: 100%;
    }
    
    .history-detail-panel {
        display: none;
        height: 100%;
    }
    
    .history-container.mobile-show-detail .history-list-panel {
        display: none;
    }
    
    .history-container.mobile-show-detail .history-detail-panel {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-back-btn {
        display: inline-flex !important;
    }
}

/* Login Overlay Style */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: radial-gradient(circle at center, rgba(10, 15, 30, 0.95) 0%, rgba(5, 7, 12, 0.98) 100%);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-overlay.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    width: 90%;
    max-width: 400px;
    padding: 40px 30px;
    background: rgba(17, 25, 40, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.login-header {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

.login-header .logo-icon {
    font-size: 40px;
    margin-bottom: 15px;
    display: inline-block;
}

.login-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-form {
    position: relative;
    z-index: 1;
}

.password-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.password-input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 45px 14px 18px;
    border-radius: 12px;
    color: #FFF;
    font-size: 16px;
    outline: none;
    transition: var(--transition-smooth);
    text-align: center;
    letter-spacing: 4px;
}

.password-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.password-input-wrapper .toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-smooth);
}

.password-input-wrapper .toggle-password:hover {
    color: var(--text-main);
}

.login-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    color: #FFF;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    font-family: 'Inter', sans-serif;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.login-error {
    margin-top: 15px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-error.show {
    opacity: 1;
}

/* Shake Keyframes */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}
