/* ==========================================================================
   BYD Atto 3 Charging & Cost Tracker CSS
   Theme: Sci-Fi Glassmorphism (Dark Mode)
   ========================================================================== */

/* Variables & Base Config */
:root {
    --bg-app: #08090e;
    --bg-card: rgba(17, 20, 32, 0.55);
    --bg-card-hover: rgba(22, 26, 42, 0.75);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-card-focus: rgba(0, 168, 255, 0.4);
    
    /* Neon Accents */
    --color-primary: #00e5ff;       /* Cyan */
    --color-primary-rgb: 0, 229, 255;
    --color-secondary: #bd00ff;     /* Purple/Violet */
    --color-secondary-rgb: 189, 0, 255;
    --color-success: #00e676;       /* Neon Green */
    --color-danger: #ff1744;        /* Neon Red */
    --color-warning: #ffea00;       /* Neon Yellow */
    --color-orange: #ff9100;        /* Orange */

    /* Typography colors */
    --text-main: #f1f3f9;
    --text-muted: #8a96a3;
    --text-dim: #54606f;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.25);
    --shadow-glow-purple: 0 0 20px rgba(189, 0, 255, 0.25);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: 'Inter', 'Sarabun', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Ambient Glow Blobs in Background */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary) 0%, rgba(0, 0, 0, 0) 70%);
    top: -200px;
    left: -100px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-secondary) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -150px;
    right: -100px;
}

.glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--color-orange) 0%, rgba(0, 0, 0, 0) 70%);
    top: 40%;
    right: 25%;
}

/* App Container Layout */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Logo styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-radius: 20px;
    background: rgba(10, 11, 21, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-card);
    margin-bottom: 25px;
    box-shadow: var(--shadow-card);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.4));
}

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.logo-text h1 span {
    background: linear-gradient(90deg, var(--color-primary), #00b0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Navigation Tabs */
.app-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-normal);
}

.nav-btn i {
    font-size: 1.1rem;
}

.nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: #fff;
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
}

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

.card-header {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 15px;
}

.card-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Tab Panels Visibility */
.tab-content {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.tab-content.active {
    display: block;
}

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

/* Metrics Dashboard Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
}

.metric-card:nth-child(1)::before { background: var(--color-orange); }
.metric-card:nth-child(2)::before { background: var(--color-primary); }
.metric-card:nth-child(3)::before { background: var(--color-success); }
.metric-card:nth-child(4)::before { background: var(--color-secondary); }
.metric-card:nth-child(5)::before { background: #00e5ff; }

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

.metric-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
}

/* Color gradients for card icons */
.bg-gradient-orange { background: linear-gradient(135deg, #ffab40, var(--color-orange)); }
.bg-gradient-blue { background: linear-gradient(135deg, #40c4ff, #0091ea); }
.bg-gradient-green { background: linear-gradient(135deg, #69f0ae, var(--color-success)); }
.bg-gradient-purple { background: linear-gradient(135deg, #ea80fc, var(--color-secondary)); }
.bg-gradient-cyan { background: linear-gradient(135deg, #84ffff, var(--color-primary)); }

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.metric-footer {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Text Accent colors */
.text-orange { color: var(--color-orange); }
.text-blue { color: #00b0ff; }
.text-green { color: var(--color-success); }
.text-purple { color: #d500f9; }
.text-cyan { color: var(--color-primary); }

/* Dashboard Layout structure */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
}

.charts-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.charts-row {
    display: flex;
    gap: 20px;
}

.chart-container {
    width: 100%;
}

.chart-container.half-width {
    width: calc(50% - 10px);
}

.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Spec Card Styles */
.spec-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.spec-item:last-child {
    border: none;
    padding-bottom: 0;
}

.spec-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.spec-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.highlight-green {
    color: var(--color-success);
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

/* Actions Card UI */
.actions-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Buttons style */
.btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(95deg, var(--color-primary) 0%, #00b0ff 100%);
    color: #06070a;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.05);
}

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

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

.btn-secondary-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 23, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(255, 23, 68, 0.4);
}

.btn-danger-outline {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid rgba(255, 23, 68, 0.3);
}

.btn-danger-outline:hover {
    background: rgba(255, 23, 68, 0.1);
    border-color: var(--color-danger);
}

.btn-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-chip:hover, .btn-chip.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Recent list UI */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.recent-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.recent-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.recent-type-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.type-home-color { background-color: var(--color-success); }
.type-station-color { background-color: var(--color-primary); }

.recent-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-odo {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.recent-cost {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
}

.recent-cost span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.no-data {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
    padding: 15px 0;
}

/* ==========================================================================
   Form Styling (Tab 2: Add Record)
   ========================================================================== */
.form-layout {
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.col-span-2 {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    font-size: 1rem;
    color: var(--color-primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group textarea,
.select-dropdown {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 15px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus,
.select-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.form-group input[readonly] {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-helper {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Custom Segmented Control for Charging Type */
.segmented-control {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
    position: relative;
    width: 100%;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segment-label {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Radio States */
#type-home:checked ~ label[for="type-home"] {
    background: rgba(0, 230, 118, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

#type-station:checked ~ label[for="type-station"] {
    background: rgba(0, 229, 255, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.rate-shortcuts-container {
    display: flex;
    gap: 6px;
    margin-top: 5px;
}

.rate-shortcuts-container.hidden {
    display: none !important;
}

/* Toggle Checkbox style */
.override-toggle-container {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    margin-right: 10px;
    transition: var(--transition-fast);
}

.checkbox-label:hover input ~ .custom-checkbox {
    border-color: var(--color-primary);
}

.checkbox-label input:checked ~ .custom-checkbox {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.custom-checkbox:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked ~ .custom-checkbox:after {
    display: block;
}

.checkbox-label .custom-checkbox:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #06070a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.checkbox-label input:checked ~ .checkbox-text {
    color: var(--text-main);
}

/* Info boxes in Form */
.info-box-group {
    justify-content: flex-end;
    padding-bottom: 8px;
}

.prev-odo-badge {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
}

.prev-odo-badge strong {
    color: var(--color-primary);
}

/* Preview Summary Box */
.preview-card {
    background: rgba(0, 229, 255, 0.02);
    border-color: rgba(0, 229, 255, 0.1);
    margin-bottom: 25px;
}

.preview-card h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--color-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.prev-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.prev-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.prev-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.highlight-orange {
    color: var(--color-orange);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   History Tab Elements (Tab 3: History Log)
   ========================================================================== */
.history-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.history-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-box input {
    padding-left: 35px !important;
    width: 220px;
}

.select-dropdown {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a96a3' width='18' height='18'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px !important;
    appearance: none;
    -webkit-appearance: none;
}

/* Table Style */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-top: 15px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.history-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

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

.text-right { text-align: right; }
.text-center { text-align: center; }

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-home {
    background: rgba(0, 230, 118, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-station {
    background: rgba(0, 229, 255, 0.12);
    color: var(--color-primary);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.no-data-cell {
    text-align: center;
    color: var(--text-dim);
    padding: 40px 0 !important;
    font-size: 1rem;
}

.no-data-cell i {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-dim);
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.btn-delete:hover {
    color: var(--color-danger);
    background: rgba(255, 23, 68, 0.1);
}

/* Alert Notifications */
.alert-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
}

.alert-toast {
    background: rgba(18, 20, 32, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 4px solid var(--color-primary);
    color: var(--text-main);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alert-toast.success { border-left-color: var(--color-success); }
.alert-toast.error { border-left-color: var(--color-danger); }
.alert-toast.info { border-left-color: var(--color-primary); }

.alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-content i {
    font-size: 1.1rem;
}

.alert-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.alert-close:hover {
    color: var(--text-main);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Confirm Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 6, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast) ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    max-width: 400px;
    width: 90%;
    text-align: center;
    padding: 30px;
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.modal-icon.text-danger {
    color: var(--color-danger);
    filter: drop-shadow(0 0 10px rgba(255, 23, 68, 0.3));
}

.modal-box h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.modal-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Footer elements */
.app-footer-bar {
    margin-top: auto;
    padding: 30px 0 10px 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .side-column {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .side-column > div {
        flex: 1;
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .app-nav {
        width: 100%;
        justify-content: space-between;
    }

    .nav-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .nav-btn span {
        display: none; /* Hide icon text on very small screens to fit layout */
    }
    .nav-btn i {
        margin: 0;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-grid .metric-card:last-child {
        grid-column: span 2;
    }

    .charts-row {
        flex-direction: column;
    }

    .chart-container.half-width {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .info-box-group {
        justify-content: flex-start;
    }
    .history-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    .history-actions {
        width: 100%;
        justify-content: space-between;
    }
    .search-box {
        flex: 1;
    }
    .search-box input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .metrics-grid .metric-card:last-child {
        grid-column: span 1;
    }
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading State visual feedback */
body.loading-state {
    cursor: wait !important;
    pointer-events: none !important;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

