/* * ERP Modern UI Framework 
 * Standard for Retail & Service Management
 */

:root {
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --primary: #3b82f6; /* Modern Blue */
    --primary-dark: #1d4ed8;
    --bg-main: #f8fafc;
    --sidebar-bg: #1e293b; /* Deep Navy */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- SIDEBAR LAYOUT --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 25px;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f172a;
}

.logo-box {
    background: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.nav-label {
    padding: 20px 25px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #475569;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

/* --- MAIN CONTENT & TOPBAR --- */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: var(--white);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 900;
}

.page-header-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 6px 6px;
    background: var(--bg-main);
    border-radius: 50px;
    border: 1px solid var(--border);
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); display: block; }

.logout-btn {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.logout-btn:hover { color: #ef4444; }

/* --- DASHBOARD ELEMENTS --- */
.scroll-container {
    padding: 30px 40px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-card h4 {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
}

/* --- TABLES --- */
.erp-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    overflow: hidden;
}

.erp-table th {
    background: #fcfcfd;
    padding: 15px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.erp-table td {
    padding: 18px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.erp-table tr:last-child td { border-bottom: none; }

.badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge.pending { background: #fff7ed; color: #c2410c; }
.badge.success { background: #f0fdf4; color: #15803d; }

/* --- FOOTER --- */
.footer-bar {
    margin-top: auto;
    padding: 20px 40px;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}


.settings-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid var(--border);
    padding-right: 20px;
}

.s-nav-btn {
    padding: 12px;
    text-align: left;
    background: none;
    border: none;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
}

.s-nav-btn.active {
    background: var(--bg-main);
    color: var(--primary);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s; }

.section-title { margin-bottom: 20px; font-size: 18px; border-bottom: 2px solid var(--bg-main); padding-bottom: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px;
}

.btn-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Sidebar Icon Placeholders */
.icon-settings::before { content: '⚙'; margin-right: 10px; font-style: normal; }
.icon-dash::before     { content: '📊'; margin-right: 10px; font-style: normal; }
.icon-pc::before       { content: '💻'; margin-right: 10px; font-style: normal; }
.icon-print::before    { content: '🖨'; margin-right: 10px; font-style: normal; }
.icon-cam::before      { content: '📹'; margin-right: 10px; font-style: normal; }
.icon-tool::before     { content: '🔧'; margin-right: 10px; font-style: normal; }
.icon-box::before      { content: '📦'; margin-right: 10px; font-style: normal; }



/* Placeholder Icon Styling */
.placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #cbd5e1;
    font-weight: 300;
    background: #f8fafc;
}

/* Base Preview Box */
.preview-box {
    margin-top: 10px;
    width: 120px;
    height: 120px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Wide box for signatures */
.sig-preview-box {
    width: 200px;
    height: 80px;
}

/* Toast Notification - Positioned Bottom Left */
.toast {
    position: fixed;
    bottom: 25px;         /* Anchored to bottom */
    right: 25px;           /* Anchored to left */
    background: #10b981;  /* Success Green */
    color: white;
    padding: 16px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    
    /* Hidden state (Off-screen to the left) */
    visibility: hidden;
    opacity: 0;
    transform: translateX(-150%); 
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Show state (Slides into view) */
.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}


/* Top Bar Branding Area */
.topbar-brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.topbar-shop-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar-divider {
    color: #cbd5e1;
    margin: 0 5px;
}

.topbar-page-title {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
}

/* User Pill Avatar Styling */
.avatar {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.erp-switch {
    display: inline-block;
    cursor: pointer;
}
.erp-switch input:focus + .erp-slider {
    box-shadow: 0 0 1px #10b981;
}

.form-footer { 
    margin-top: 30px; 
    display: flex; 
    gap: 15px; 
    justify-content: flex-end; 
    border-top: 1px solid #f1f5f9; 
    padding-top: 20px; 
}

/* Base style for both buttons to ensure they match exactly */
.btn-save-cust, .btn-cancel-cust { 
    padding: 12px 35px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 14px;
    cursor: pointer; 
    border: none;
    transition: opacity 0.2s;
    min-width: 180px; /* Ensures consistent width */
}

.btn-save-cust { background: #3b82f6; color: white; }
.btn-cancel-cust { background: #ef4444; color: white; } /* Red background as requested */

.btn-save-cust:hover, .btn-cancel-cust:hover { opacity: 0.9; }

/* 2. Confirmation Modal Styling (Offline Ready) */
.erp-modal { 
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100% !important; 
    height: 100% !important; 
    background: rgba(15, 23, 42, 0.7) !important; 
    z-index: 99999 !important; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(2px); 
}

.modal-content {
    background: #fff;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Modal Buttons */
.btn-modal-stay { 
    background: #f1f5f9; 
    color: #475569; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 6px; 
    font-weight: 600; 
    cursor: pointer;
}

.btn-modal-leave { 
    background: #ef4444; 
    color: white; 
    text-decoration: none; 
    padding: 10px 20px; 
    border-radius: 6px; 
    font-weight: 700; 
    font-size: 14px;
}

.erp-modal {
    backdrop-filter: blur(4px); /* Adds a professional glass effect */
    transition: all 0.3s ease;
}

#alertBorder {
    animation: alertSlideDown 0.3s ease-out;
}

@keyframes alertSlideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}