/* ============================================================
   ELECTROSTOCK – PROFESSIONAL UI
   Modern, clean, responsive, with micro-interactions
   ============================================================ */
   
   
/* ─── Main Content ───────────────────────────────────────────── */
.main-content {
    margin-left: 260px;
    padding: 30px 40px 40px 40px;
    width: calc(100% - 260px);
    min-height: 100vh;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-content-wrapper {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

/* ─── Form Container ──────────────────────────────────────────── */
.form-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin: 20px auto 0 auto;
    width: 100%;
    max-width: 900px;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 80px 15px 20px 15px;
        width: 100%;
    }
    .form-container {
        padding: 24px 20px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 16px;
    }
}   
   
   

/* ─── Font & Reset ──────────────────────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

/* ─── Dashboard Layout ──────────────────────────────────────── */

.dashboard {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* ─── Sidebar ────────────────────────────────────────────────── */

.sidebar {
    width: 260px;
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    padding: 24px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.sidebar-brand h2 {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.sidebar-brand h2 span {
    color: #f0b429;
}

.sidebar ul {
    list-style: none;
    padding: 0 12px;
    flex: 1;
}

.sidebar ul li {
    margin: 2px 0;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #aab0c0;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
}

.sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.sidebar ul li a.active {
    background: rgba(240, 180, 41, 0.15);
    color: #f0b429;
}

.sidebar ul li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 3px;
    background: #f0b429;
    border-radius: 0 3px 3px 0;
}

.sidebar ul li a .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar ul li a .badge {
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 20px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 20px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.sidebar-footer a {
    color: #aab0c0;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-footer a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* ─── Main Content ───────────────────────────────────────────── */

.main-content {
    margin-left: 260px;
    padding: 30px 40px 40px 40px;
    width: calc(100% - 260px);
    min-height: 100vh;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-content-wrapper {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

/* ─── Page Header ───────────────────────────────────────────── */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 28px;
    width: 100%;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    margin: 0;
}

.breadcrumb {
    font-size: 14px;
    color: #6c757d;
    margin-top: 4px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.total-badge {
    background: #e9ecef;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* ─── KPI Cards ──────────────────────────────────────────────── */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
    width: 100%;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    border-left: 4px solid #3498db;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: rgba(52, 152, 219, 0.04);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.kpi-card h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: #7f8c8d;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 4px 0;
}

.kpi-card .kpi-sub {
    font-size: 13px;
    color: #95a5a6;
}

.kpi-card.profit { border-left-color: #2ecc71; }
.kpi-card.danger { border-left-color: #e74c3c; }
.kpi-card.info { border-left-color: #3498db; }

.kpi-card.profit::after { background: rgba(46, 204, 113, 0.06); }
.kpi-card.danger::after { background: rgba(231, 76, 60, 0.06); }

/* ─── Form Container ──────────────────────────────────────────── */

.form-container {
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin-top: 20px;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-column h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.required {
    color: #e74c3c;
    font-weight: 700;
}

.form-control {
    padding: 10px 14px;
    border: 2px solid #e0e4e8;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background: #fafbfc;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #f0b429;
    outline: none;
    box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.1);
    background: #fff;
}

.form-control:disabled {
    background: #f1f3f5;
    color: #6c757d;
}

.form-text {
    font-size: 12px;
    margin-top: 4px;
}

.text-muted { color: #95a5a6; }
.text-info { color: #3498db; }
.text-danger { color: #e74c3c; }
.text-success { color: #2ecc71; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px solid #f0f2f5;
    flex-wrap: wrap;
}

/* ─── Tables ─────────────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0;
    margin-top: 20px;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: #f8f9fa;
}

.table thead th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
    font-size: 13px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.table tbody td {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr.flag-row {
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
}

.table .status-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-ok { background: #d4edda; color: #155724; }
.status-low { background: #f8d7da; color: #721c24; }

/* ─── Cards ──────────────────────────────────────────────────── */

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    transition: all 0.2s;
    width: 100%;
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 16px;
}

/* ─── Buttons ────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: #e9ecef;
    color: #2c3e50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: #1a1a2e;
    color: #fff;
}
.btn-primary:hover {
    background: #f0b429;
    color: #1a1a2e;
}

.btn-secondary {
    background: #e9ecef;
    color: #2c3e50;
}
.btn-secondary:hover {
    background: #d5d8dc;
}

.btn-success {
    background: #2ecc71;
    color: #fff;
}
.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}
.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}
.btn-warning:hover {
    background: #d68910;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}
.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── Badge ──────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }

/* ─── Alerts ─────────────────────────────────────────────────── */

.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 4px solid transparent;
    width: 100%;
}
.alert-success { background: #d4edda; color: #155724; border-color: #2ecc71; }
.alert-error { background: #f8d7da; color: #721c24; border-color: #e74c3c; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffc107; }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #3498db; }

/* ─── Search Bar ────────────────────────────────────────────── */

.search-bar {
    background: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    width: 100%;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: 2px solid #e0e4e8;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input-wrapper input:focus {
    border-color: #f0b429;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    padding: 8px 14px;
    border: 2px solid #e0e4e8;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 2px solid #95a5a6;
    color: #7f8c8d;
}

.btn-outline:hover {
    background: #ecf0f1;
    border-color: #7f8c8d;
}

/* ─── Empty State ───────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #fafbfc;
    border-radius: 8px;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.empty-state p {
    color: #95a5a6;
    margin-bottom: 16px;
}

/* ─── Action Buttons ───────────────────────────────────────── */

.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #f1f3f5;
    color: #2c3e50;
}

.btn-action:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-view:hover { background: #3498db; color: #fff; }
.btn-edit:hover { background: #f39c12; color: #fff; }
.btn-approve:hover { background: #2ecc71; color: #fff; }
.btn-delete:hover { background: #e74c3c; color: #fff; }

/* ─── Pagination ─────────────────────────────────────────────── */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 24px;
    width: 100%;
}

.pagination .page-link {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: #f0b429;
    color: #fff;
    border-color: #f0b429;
}

.pagination .page-link.active {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

/* ─── Dashboard Grid ──────────────────────────────────────────── */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-content-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 80px 15px 20px 15px;
        width: 100%;
    }
    .main-content-wrapper {
        padding: 0;
    }
    .menu-toggle {
        display: flex !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: #1a1a2e;
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 8px 14px;
        font-size: 24px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    .menu-toggle:hover {
        background: #f0b429;
        color: #1a1a2e;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-container {
        padding: 24px 20px;
    }
    .page-header h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .kpi-card .kpi-value {
        font-size: 22px;
    }
    .form-container {
        padding: 16px;
    }
    .card {
        padding: 16px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    .btn-lg {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* ─── Responsive Helpers ────────────────────────────────────── */

.hide-on-mobile { display: inline-block; }
@media screen and (max-width: 768px) { .hide-on-mobile { display: none !important; } }
.show-on-mobile { display: none; }
@media screen and (max-width: 768px) { .show-on-mobile { display: inline-block !important; } }

/* ─── Print Styles ──────────────────────────────────────────── */

@media print {
    .sidebar, .menu-toggle, .sidebar-overlay {
        display: none !important;
    }
    .main-content {
        margin: 0 !important;
        padding: 20px !important;
        width: 100% !important;
    }
    .card, .form-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}