/* ==========================================================================
   Design System & CSS Variables
   ========================================================================== */
:root {
    /* Fonts */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Dark Theme Variables (Default) */
    --bg-app: #090d16;
    --bg-sidebar: rgba(13, 20, 35, 0.85);
    --bg-card: rgba(22, 33, 56, 0.65);
    --bg-input: rgba(13, 20, 35, 0.7);
    --bg-table-header: rgba(18, 28, 48, 0.9);
    --bg-table-row-odd: rgba(22, 33, 56, 0.25);
    --bg-table-row-hover: rgba(41, 58, 94, 0.45);
    --bg-modal: rgba(15, 23, 42, 0.95);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(0, 242, 254, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-accent: #0f172a;
    
    /* Accent Gradients & Colors */
    --accent-primary: #00f2fe;
    --accent-secondary: #4facfe;
    --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    --warning: #f59e0b;
    
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px -6px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 0 15px rgba(0, 242, 254, 0.35);
    
    --blur-val: 12px;
}

/* Light Theme Variables */
body.light-theme {
    --bg-app: #f1f5f9;
    --bg-sidebar: rgba(255, 255, 255, 0.9);
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-input: #ffffff;
    --bg-table-header: #e2e8f0;
    --bg-table-row-odd: rgba(241, 245, 249, 0.5);
    --bg-table-row-hover: rgba(226, 232, 240, 0.8);
    --bg-modal: rgba(255, 255, 255, 0.98);
    
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-focus: rgba(79, 172, 254, 0.6);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-md: 0 8px 30px -4px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px -6px rgba(15, 23, 42, 0.12);
}

/* ==========================================================================
   Basic Reset & Layouts
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Glowing Accents */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.glow-1 {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, rgba(79, 172, 254, 0) 70%);
    filter: blur(80px);
}
.glow-2 {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0) 70%);
    filter: blur(80px);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   Login Interface (Glassmorphic Card)
   ========================================================================== */
.login-wrapper {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at center, rgba(13, 20, 35, 0.2) 0%, var(--bg-app) 100%);
}
.login-wrapper.active {
    display: flex;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    margin-bottom: 16px;
    box-shadow: var(--shadow-accent);
}
.logo-icon i {
    width: 30px;
    height: 30px;
}
.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.input-wrapper {
    position: relative;
}
.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: color 0.3s;
}
.input-wrapper input, .form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:not([type="checkbox"]), .form-group select {
    padding-left: 16px; /* inputs outside wrappers without icon */
}
.input-wrapper input:focus, .form-group input:focus, .form-group select:focus {
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}
.input-wrapper input:focus + i {
    color: var(--accent-primary);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}
.form-checkbox label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}
.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}
.btn-danger {
    background: var(--danger-gradient);
    color: white;
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}
.btn-block {
    display: flex;
    width: 100%;
}

.login-footer {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}
.lang-switch-login {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
}
.btn-lang {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-lang:hover {
    color: var(--text-primary);
}
.btn-lang.active {
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Main Application Layout (Sidebar & Main content)
   ========================================================================== */
.app-wrapper {
    display: none;
    min-height: 100vh;
}
.app-wrapper.active {
    display: flex;
}

/* Sidebar styling */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border-right: 1px solid var(--border-color);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 50;
    transition: width 0.3s;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 8px;
}
.logo-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-accent);
}
.logo-icon-small i {
    width: 18px;
    height: 18px;
}
.logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.2s;
}
.nav-item i {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}
.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-table-row-odd);
}
.nav-item:hover i {
    transform: translateX(2px);
}
.nav-item.active {
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    font-weight: 600;
}
.nav-item.active i {
    color: var(--text-on-accent);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}
.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#user-display-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.user-role {
    font-size: 11px;
    color: var(--text-muted);
}
.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    justify-content: center;
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.btn-change-password {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    justify-content: center;
}
.btn-change-password:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-secondary);
}

/* Content Area Layout */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    min-height: 100vh;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#view-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
#view-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.btn-theme {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-theme:hover {
    background: var(--border-color);
}
.lang-selector {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
}

/* ==========================================================================
   Dashboard Components (File Upload, Statistics, Table)
   ========================================================================== */
.view-pane {
    display: none;
    flex-direction: column;
    gap: 32px;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.view-pane.active {
    display: flex;
}

/* Drag and Drop Zone */
.upload-zone {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.08);
    background: rgba(0, 242, 254, 0.02);
}
.upload-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: transform 0.3s;
}
.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
}
.upload-icon i {
    width: 32px;
    height: 32px;
}
.upload-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}
.upload-content p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Metrics Dashboard */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.metric-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    opacity: 0.8;
}
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-icon i {
    width: 24px;
    height: 24px;
}
.card-body {
    display: flex;
    flex-direction: column;
}
.card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.card-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.card-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--success-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
}

/* Color Coding for Metrics */
.card-sales::after { background: var(--accent-gradient); }
.card-sales .card-icon { background: rgba(79, 172, 254, 0.1); color: var(--accent-secondary); }

.card-received::after { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); }
.card-received .card-icon { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

.card-cost::after { background: var(--danger-gradient); }
.card-cost .card-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.card-profit::after { background: var(--success-gradient); }
.card-profit .card-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }

/* Tables Layout */
.data-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    max-height: 500px;
    overflow-y: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}
.data-table th {
    background-color: var(--bg-table-header);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}
.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background-color 0.2s;
}
.data-table tbody tr:nth-child(odd) {
    background-color: var(--bg-table-row-odd);
}
.data-table tbody tr:hover {
    background-color: var(--bg-table-row-hover);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Badges & Status */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.status-badge.entregue {
    background: var(--success-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}
.status-badge.other {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.text-success { color: var(--success) !important; font-weight: 600; }
.text-danger { color: var(--danger) !important; font-weight: 600; }
.text-muted-cell { color: var(--text-muted); font-size: 12px; }

/* ==========================================================================
   Cost DB & User Management Panel Custom Styles
   ========================================================================== */
.db-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}
.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}
.search-box input {
    padding-left: 42px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 32px;
}
.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.panel-card h3 {
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.table-container.compact {
    max-height: 320px;
}
.data-table td .btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.data-table td .btn-icon:hover {
    background: var(--border-color);
}
.data-table td .btn-icon.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}
.data-table td .btn-icon.btn-edit:hover {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-primary);
}

/* ==========================================================================
   Modal Dialog Layouts & Backdrops
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 16, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-card.modal-large {
    max-width: 720px;
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}
.modal-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
}
.modal-body.overflow-y {
    max-height: 45vh;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Modal form adjustments */
.modal-body .table-container {
    background: transparent;
    border: none;
    box-shadow: none;
}
.modal-body table input[type="number"] {
    width: 100px;
    padding: 8px 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
}

/* ==========================================================================
   Toast Notification Styling
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 280px;
    max-width: 420px;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

.toast-icon { display: flex; align-items: center; }
.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-danger .toast-icon { color: var(--danger); }
.toast.toast-warning .toast-icon { color: var(--warning); }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleUp {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Responsive Styling (Media Queries)
   ========================================================================== */
@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 32px 10px;
    }
    .sidebar-header .logo-text,
    .sidebar-nav .nav-item span,
    .sidebar-footer .user-info,
    .sidebar-footer .btn-logout span {
        display: none;
    }
    .sidebar-header {
        justify-content: center;
        padding-left: 0;
        margin-bottom: 30px;
    }
    .sidebar-footer {
        align-items: center;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .nav-item:hover i {
        transform: none;
    }
    .btn-logout {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 12px;
    }
    .main-content {
        margin-left: 70px;
        padding: 24px;
    }
    #view-title {
        font-size: 22px;
    }
    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .db-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: 100%;
    }
    .modal-card {
        max-height: 95vh;
    }
}

/* Password Toggle Button */
.input-wrapper input[type="password"] {
    padding-right: 42px;
}
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
    z-index: 5;
}
.btn-toggle-password:hover {
    color: var(--accent-primary);
    background-color: var(--border-color);
}
.btn-toggle-password i {
    width: 18px;
    height: 18px;
}

/* Protocol Warning Banner */
.protocol-warning-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    color: #fca5a5;
    animation: fadeIn 0.3s ease-out;
}
.protocol-warning-banner i {
    width: 24px;
    height: 24px;
    color: var(--danger);
    flex-shrink: 0;
}
.warning-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.warning-text strong {
    font-size: 13px;
    font-weight: 600;
}
.warning-text p {
    font-size: 11px;
    color: #f87171;
    line-height: 1.4;
}
