/* Inventory Management System - Bright Light Theme */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #14b8a6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark-bg: #f4f8ff;
    --dark-card: #ffffff;
    --dark-border: #dbe5f3;
    --light-text: #0f172a;
    --gray-text: #64748b;
    --sidebar-width: 260px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: radial-gradient(circle at top left, #eff6ff 0%, #f8fbff 45%, #eefdf7 100%);
}

body {
    background: radial-gradient(circle at top left, #eff6ff 0%, #f8fbff 45%, #eefdf7 100%);
    color: var(--light-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-right: 1px solid var(--dark-border);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 1000;
    padding-top: 20px;
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.08);
}

.sidebar-header {
    padding: 0 20px 30px;
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h5 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.sidebar-nav {
    list-style: none;
    padding: 20px 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
    border-radius: 0 999px 999px 0;
    margin-right: 12px;
}

.sidebar-nav a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    padding-left: 24px;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.16), rgba(20, 184, 166, 0.12));
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-nav i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-nav span {
    white-space: nowrap;
}

.sidebar-nav .divider {
    margin: 15px 0;
    border-top: 1px solid var(--dark-border);
}

.btn-install {
    margin: 20px;
    width: calc(100% - 40px);
    padding: 10px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.22);
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 999;
    backdrop-filter: blur(14px);
}

.btn-menu {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.header-title h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--light-text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    position: relative;
}

.user-menu a {
    color: var(--light-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.user-menu a:hover {
    color: var(--primary);
}

.user-menu .dropdown-menu {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.user-menu .dropdown-item {
    color: var(--light-text);
    padding: 10px 15px;
}

.user-menu .dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--header-height));
}

.main-content > .container-fluid,
.main-content > .container,
.main-content > .row {
    position: relative;
    z-index: 1;
}

/* Dashboard Cards - Modern Horizontal Layout */
.metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;

    padding: 18px 20px;
    padding-bottom: 45px;

    min-height: 150px;
    height: 100%;

    position: relative;

    cursor: pointer;

    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: #82b3ef;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.metric-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.metric-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    font-size: 20px;
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.metric-card.metric-card-indigo {
    border-left: 4px solid #2563eb;
}

.metric-card.metric-card-indigo .metric-card-icon {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: #2563eb;
}

.metric-card.metric-card-teal {
    border-left: 4px solid #0d9488;
}

.metric-card.metric-card-teal .metric-card-icon {
    background: linear-gradient(135deg, #ccfbf1, #f0fdfa);
    color: #0d9488;
}

.metric-card.metric-card-amber {
    border-left: 4px solid #d97706;
}

.metric-card.metric-card-amber .metric-card-icon {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    color: #d97706;
}

.metric-card.metric-card-blue {
    border-left: 4px solid #0284c7;
}

.metric-card.metric-card-blue .metric-card-icon {
    background: linear-gradient(135deg, #cffafe, #f0f9ff);
    color: #0284c7;
}

.metric-card.metric-card-rose {
    border-left: 4px solid #e11d48;
}

.metric-card.metric-card-rose .metric-card-icon {
    background: linear-gradient(135deg, #ffe4e6, #fff1f2);
    color: #e11d48;
}

.metric-card-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.metric-card-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    line-height: 1.2;
}

.metric-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}
.metric-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.metric-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.metric-card-label-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.metric-card-label {
    margin: 0;
}

.metric-card-value {
    margin: 0;
}

.metric-card-subtext {
    position: absolute;
    bottom: 14px;
    left: 20px;
    right: 20px;

    font-size: 12px;
    color: #78909c;

    border-top: 1px solid #e2e8f0;
    padding-top: 8px;

    text-align: left;
    line-height: 1.2;
}

@media (max-width: 991px) {
    .metric-card-subtext {
        display: none;
    }
}

@media (max-width: 575px) {
    .metric-card {
        padding: 16px 18px;
        gap: 12px;
    }

    .metric-card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .metric-card-label {
        font-size: 10px;
    }

    .metric-card-value {
        font-size: 24px;
    }
}

.settings-tile {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(96, 165, 250, 0.06));
    border: 1px solid var(--dark-border);
    border-radius: 10px;
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    text-align: center;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.settings-tile:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.settings-tile-icon {
    font-size: 20px;
    color: #2563eb;
    line-height: 1;
}

.settings-tile-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--light-text);
    line-height: 1.2;
}

.settings-tile-count {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
}

.dashboard-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
    border: 1px solid var(--dark-border);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
}

.dashboard-panel-accent {
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.95), rgba(220, 234, 255, 0.9));
}

.dashboard-panel-title {
    color: #102a43;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.dashboard-panel-header {
    margin-bottom: 24px;
}

.dashboard-panel-copy {
    margin: 0;
    font-size: 14px;
    color: rgba(15, 23, 42, 0.75);
}

.chart-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 8px;
    background: rgba(221, 238, 250, 0.85);
    border-radius: 18px;
}

/*.chart-wrapper canvas {
    width: 300px !important;
    height: 300px !important;
    max-width: 300px !important;
    max-height: 300px !important;
}*/

.chart-error {
    text-align: center;
    padding: 28px 16px;
    background: rgba(243, 244, 246, 0.95);
    border-radius: 16px;
    color: rgba(15, 23, 42, 0.8);
    font-size: 15px;
    line-height: 1.6;
    max-width: 420px;
}

.metric-card .metric-card-value {
    color: #071a52;
}

.metric-card .metric-card-subtext {
    color: rgba(15, 23, 42, 0.6);
}

.metric-card-label {
    color: rgba(15, 23, 42, 0.7);
}

@media (max-width: 991px) {
    .dashboard-panel {
        min-height: auto;
    }

    .chart-wrapper {
        min-height: 320px;
    }
}

.surface-indigo {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(96, 165, 250, 0.08));
}

.surface-teal {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(45, 212, 191, 0.08));
}

.surface-amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(251, 191, 36, 0.08));
}

.surface-rose {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(244, 114, 182, 0.08));
}

.surface-sky {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(125, 211, 252, 0.08));
}

.surface-violet {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(196, 181, 253, 0.08));
}

.surface-lime {
    background: linear-gradient(135deg, rgba(132, 204, 22, 0.14), rgba(190, 242, 100, 0.08));
}

.surface-soft {
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.surface-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.94));
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

/* Modal accent variants */
.modal-accent-indigo .modal-content,
.modal-accent .modal-content {
    background: linear-gradient(180deg, #ffffff, #eff6ff);
    border: 1px solid rgba(37, 99, 235, 0.08);
}

.modal-accent-teal .modal-content {
    background: linear-gradient(180deg, #ffffff, #ecfeff);
    border: 1px solid rgba(20, 184, 166, 0.08);
}

.modal-accent-amber .modal-content {
    background: linear-gradient(180deg, #ffffff, #fffbeb);
    border: 1px solid rgba(245, 158, 11, 0.08);
}

.modal-accent-rose .modal-content {
    background: linear-gradient(180deg, #ffffff, #fff1f2);
    border: 1px solid rgba(239, 68, 68, 0.08);
}

/* Table surface variants */
.table-surface {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border: 1px solid var(--dark-border);
    border-radius: 10px;
    overflow: hidden;
}

.table-surface thead {
    background: linear-gradient(90deg, rgba(37,99,235,0.06), rgba(6,182,212,0.04));
}

.table-surface tbody td {
    color: var(--light-text);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Tables */
.table {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.table thead {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(20, 184, 166, 0.08));
    border-bottom: 1px solid var(--dark-border);
}

.table thead th {
    color: var(--light-text);
    font-weight: 600;
    padding: 15px;
    border: none;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    color: var(--light-text);
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

/* Modals */
.modal-content {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.modal-header {
    border-bottom: 1px solid var(--dark-border);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), rgba(20, 184, 166, 0.06));
}

.modal-header .btn-close {
    filter: none;
}

.modal-title {
    color: var(--light-text);
    font-weight: 600;
}

/* Forms */
.form-label {
    color: var(--light-text);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control,
.form-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--light-text);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.form-control:focus,
.form-select:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    color: var(--light-text);
}

.form-control::placeholder {
    color: var(--gray-text);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 16px;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: white;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #14b8a6, #10b981);
    color: white;
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.18);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(20, 184, 166, 0.26);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: white;
    box-shadow: 0 10px 24px rgba(6, 182, 212, 0.18);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(6, 182, 212, 0.24);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.18);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(245, 158, 11, 0.24);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    color: white;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.18);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(239, 68, 68, 0.24);
    color: white;
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: rgba(37, 99, 235, 0.08);
}

.btn-outline-success {
    border: 1px solid #10b981;
    color: #059669;
}

.btn-outline-success:hover {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
}

.btn-outline-info {
    border: 1px solid #06b6d4;
    color: #0891b2;
}

.btn-outline-info:hover {
    background: rgba(6, 182, 212, 0.08);
    color: #0e7490;
}

.btn-outline-warning {
    border: 1px solid #f59e0b;
    color: #d97706;
}

.btn-outline-warning:hover {
    background: rgba(245, 158, 11, 0.08);
    color: #b45309;
}

.btn-outline-danger {
    border: 1px solid #ef4444;
    color: #dc2626;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(6, 182, 212, 0.08);
    color: #0e7490;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.alert-success {
    background: rgba(20, 184, 166, 0.08);
    color: #0f766e;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .top-header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }

    .btn-menu {
        display: block;
    }

    .btn-close-sidebar {
        display: block;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }

    .top-header {
        padding: 0 15px;
    }

    .header-title h4 {
        font-size: 18px;
    }

    .main-content {
        padding: 15px;
    }

    .metric-card {
        padding: 15px;
    }

    .metric-card-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 56px;
    }

    .metric-card-icon {
        font-size: 24px;
    }

    .metric-card-value {
        font-size: 20px;
    }

    .table {
        font-size: 12px;
    }

    .table thead th,
    .table tbody td {
        padding: 8px 10px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.10), transparent 28%),
        radial-gradient(circle at 12% 20%, rgba(20, 184, 166, 0.08), transparent 22%),
        radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.08), transparent 22%);
    z-index: 0;
}
