/* ============================================
   Inventory Management System - Main Stylesheet
   ============================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #475569;
    --success-color: #16a34a;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --body-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-hover);
}

/* ============================================
   Layout - Sidebar
   ============================================ */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 80px;
}

.sidebar-logo-link {
    display: block;
    text-decoration: none;
}

.sidebar-logo {
    max-width: 180px;
    max-height: 60px;
    width: auto;
    height: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.2s ease;
}

.sidebar-logo:hover {
    transform: scale(1.02);
}

/* Old logo styles (kept for compatibility) */
.sidebar-header .logo {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.sidebar-header h4 {
    color: white;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 15px 0 30px 0;
    list-style: none;
    margin: 0;
    height: calc(100vh - 80px);
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar */
.sidebar-menu::-webkit-scrollbar {
    width: 8px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

/* Firefox scrollbar */
.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.05);
}

/* Collapsible Menu Section */
.sidebar-menu .menu-section {
    margin: 5px 10px;
}

.sidebar-menu .menu-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 10px;
    user-select: none;
}

.sidebar-menu .menu-header:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu .menu-header .section-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    opacity: 0.9;
}

.sidebar-menu .menu-header span {
    flex: 1;
}

.sidebar-menu .menu-header .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.sidebar-menu .menu-section.expanded .menu-header .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-menu .menu-section.expanded .menu-header {
    color: white;
    background: rgba(255,255,255,0.05);
}

/* Submenu (collapsed by default) */
.sidebar-menu .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
}

.sidebar-menu .menu-section.expanded .submenu {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
    padding: 5px 0;
}

.sidebar-menu .submenu .menu-item {
    margin: 2px 8px;
}

.sidebar-menu .submenu .menu-link {
    padding: 10px 15px 10px 42px;
    font-size: 13px;
}

.sidebar-menu .submenu .menu-link i {
    font-size: 16px;
}

.sidebar-menu .menu-item {
    margin: 2px 10px;
}

.sidebar-menu .menu-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-text);
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 12px;
}

.sidebar-menu .menu-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu .menu-link.active {
    background: var(--sidebar-active);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.sidebar-menu .menu-link.active i {
    color: white;
}

.sidebar-menu .menu-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-menu .menu-link span {
    font-size: 14px;
}

/* ============================================
   Layout - Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Layout - Topbar
   ============================================ */
.topbar {
    height: var(--topbar-height);
    background: white;
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-left h5 {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-dropdown:hover {
    background: #f1f5f9;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    line-height: 1.3;
}

.user-info .name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.user-info .role {
    font-size: 12px;
    color: #64748b;
}

/* ============================================
   Layout - Content Area
   ============================================ */
.content-wrapper {
    flex: 1;
    padding: 25px;
}

.page-header {
    margin-bottom: 25px;
}

.page-header h4 {
    margin: 0 0 5px;
    font-weight: 600;
    color: #1e293b;
}

.page-header .breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
    font-size: 13px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    background: white;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ============================================
   Tables
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

/* ============================================
   Forms
   ============================================ */
.form-control, .form-select {
    border-radius: 6px;
    border-color: #cbd5e1;
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
}

/* ============================================
   Auth Pages (Login, Signup)
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
}

.auth-header {
    background: var(--sidebar-bg);
    padding: 30px;
    text-align: center;
}

.auth-logo {
    max-width: 220px;
    max-height: 80px;
    width: auto;
    height: auto;
}

.auth-header .logo {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    margin-bottom: 15px;
}

.auth-header h4 {
    color: white;
    margin: 0;
    font-weight: 600;
}

.auth-header p {
    color: #94a3b8;
    margin: 8px 0 0;
    font-size: 14px;
}

/* Dashboard logo */
.dashboard-logo {
    max-width: 150px;
    max-height: 100px;
    width: auto;
    height: auto;
}

.auth-body {
    padding: 30px;
}

.auth-body .form-group {
    margin-bottom: 20px;
}

.auth-body .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.auth-footer {
    text-align: center;
    padding: 20px 30px 30px;
    border-top: 1px solid #e2e8f0;
}

.auth-footer a {
    font-weight: 500;
}

/* ============================================
   Await Approval Page
   ============================================ */
.await-approval-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    padding: 20px;
}

.await-card {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    text-align: center;
    padding: 50px 40px;
}

.await-card .icon {
    width: 80px;
    height: 80px;
    background: #fef3c7;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.await-card .icon i {
    font-size: 40px;
    color: #d97706;
}

.await-card h3 {
    color: #1e293b;
    margin-bottom: 15px;
}

.await-card p {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
}

/* ============================================
   Stats Cards
   ============================================ */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card .icon.primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-card .icon.success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success-color);
}

.stat-card .icon.warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.stat-card .icon.danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.stat-card .icon.info {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.stat-card .info h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .info p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* ============================================
   Modal Customizations
   ============================================ */
.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.bg-primary-light { background-color: rgba(37, 99, 235, 0.1); }
.bg-success-light { background-color: rgba(22, 163, 74, 0.1); }
.bg-warning-light { background-color: rgba(217, 119, 6, 0.1); }
.bg-danger-light { background-color: rgba(220, 38, 38, 0.1); }
