/* Ador Core Design Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary: #6366f1;         /* Sleek Indigo */
    --primary-hover: #4f46e5;
    --accent: #10b981;          /* Emerald Green */
    --accent-hover: #059669;
    --warning: #f59e0b;         /* Amber */
    --danger: #ef4444;          /* Soft Rose Rose */
    --danger-hover: #dc2626;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --input-bg: #111827;
    --input-focus-bg: #1f2937;
    --auth-bg: radial-gradient(circle at 10% 20%, rgb(18, 16, 44) 0%, rgb(11, 15, 25) 90%);
    --auth-card-bg: rgba(17, 24, 39, 0.6);
}

:root[data-theme="light"] {
    --bg-primary: #f6f8fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef2f7;
    --text-primary: #172033;
    --text-secondary: #5f6b7a;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #0f9f6e;
    --accent-hover: #047857;
    --warning: #c47a08;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --border-color: #d9e0ea;
    --shadow-sm: 0 1px 2px 0 rgba(18, 24, 38, 0.08);
    --shadow-md: 0 4px 10px -4px rgba(18, 24, 38, 0.18);
    --shadow-lg: 0 14px 30px -18px rgba(18, 24, 38, 0.34);
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(23, 32, 51, 0.1);
    --input-bg: #ffffff;
    --input-focus-bg: #ffffff;
    --auth-bg: radial-gradient(circle at 10% 20%, rgb(231, 239, 255) 0%, rgb(246, 248, 251) 90%);
    --auth-card-bg: rgba(255, 255, 255, 0.88);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

body,
.content-wrapper,
.sidebar,
.card-premium,
.pos-checkout-panel,
.form-control-premium,
.table-premium tr,
.input-group-text,
.modal-content,
.list-group-item {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Scrollbar Modern Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism Cards */
.card-premium {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -5px rgba(99, 102, 241, 0.15);
}

.card-header-premium {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

/* Master Layout Sidebar grid */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Custom Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.sidebar,
.sidebar * {
    box-sizing: border-box;
}

.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.sidebar-brand a {
    min-width: 0;
}

.sidebar-collapse-btn {
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    display: inline-flex;
    flex-shrink: 0;
    height: 34px;
    justify-content: center;
    transition: all 0.2s ease;
    width: 34px;
}

.sidebar-collapse-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sidebar-menu {
    flex: 0 0 auto;
    padding: 20px 14px;
    list-style: none;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
    text-align: center;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--primary);
    color: white;
}

.theme-toggle-btn {
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    display: flex;
    font-weight: 600;
    gap: 10px;
    justify-content: center;
    padding: 10px 12px;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.theme-toggle-icon {
    display: inline-flex;
    justify-content: center;
    width: 18px;
}

.sidebar-actions {
    flex: 0 0 auto;
    margin-top: 4px;
}

.sidebar.is-collapsed {
    width: 76px;
}

.sidebar.is-collapsed .sidebar-text,
.sidebar.is-collapsed .theme-toggle-label {
    display: none !important;
}

.sidebar.is-collapsed .sidebar-brand {
    justify-content: center;
    padding: 18px 12px;
}

.sidebar.is-collapsed .sidebar-brand a {
    display: none !important;
}

.sidebar.is-collapsed .sidebar-collapse-btn {
    margin: 0;
}

.sidebar.is-collapsed .sidebar-user {
    justify-content: center;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.sidebar.is-collapsed .sidebar-user > div:first-child {
    margin-right: 0 !important;
}

.sidebar.is-collapsed .sidebar-menu {
    padding: 14px 10px;
}

.sidebar.is-collapsed .sidebar-link {
    justify-content: center;
    padding: 12px 10px;
}

.sidebar.is-collapsed .sidebar-link i {
    margin-right: 0;
    width: auto;
}

.sidebar.is-collapsed .sidebar-actions {
    padding: 12px 10px !important;
}

.sidebar.is-collapsed .theme-toggle-btn,
.sidebar.is-collapsed .sidebar-actions .btn {
    height: 42px;
    padding: 0;
}

.sidebar.is-collapsed .sidebar-actions .btn i {
    margin: 0 !important;
}

/* Content Wrapper */
.content-wrapper {
    flex-grow: 1;
    background-color: var(--bg-primary);
    overflow-y: auto;
}

/* Gorgeous Forms */
.form-control-premium {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 16px;
    transition: all 0.2s ease;
}

.form-control-premium:focus {
    background-color: var(--input-focus-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
    outline: none;
}

/* Premium Action Buttons */
.btn-premium-primary {
    background-color: var(--primary);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-premium-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-premium-accent {
    background-color: var(--accent);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-premium-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* Premium Tables */
.table-premium {
    width: 100%;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-premium th {
    background-color: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border: none;
    padding: 12px 20px;
}

.table-premium tr {
    background-color: var(--bg-secondary);
    border-radius: 12px;
}

.table-premium td {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.table-premium td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table-premium td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Modern POS Screen Overrides */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

@media (max-width: 992px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.pos-cart-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pos-cart-items {
    flex-grow: 1;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

.pos-checkout-panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#pos-checkout-form {
    gap: 16px;
    min-height: 100%;
}

#pos-checkout-form h5 {
    align-items: center;
    display: flex;
    font-size: 1.1rem;
    line-height: 1.25;
}

#pos-checkout-form h5 + .mb-3,
#pos-checkout-form h5 + .mb-3 + .mb-3,
#pos-checkout-form h5 + .mb-3 + .mb-3 + .mb-4 {
    margin-bottom: 14px !important;
}

#pos-checkout-form .form-label {
    font-size: 0.78rem !important;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.pos-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 1rem;
}

.pos-checkout-panel .pos-summary-item {
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 0;
    padding: 10px 0;
}

.pos-checkout-panel .pos-summary-item span:last-child {
    color: var(--text-primary) !important;
    font-weight: 700;
}

.pos-total-display {
    border-top: 2px dashed var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
}

.pos-checkout-panel .pos-total-display {
    align-items: flex-start !important;
    border-top: 1px solid rgba(16, 185, 129, 0.35);
    border-bottom: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding: 18px 0;
}

.pos-checkout-panel .pos-total-display span:first-child {
    color: var(--text-secondary) !important;
    font-size: 0.8rem !important;
    font-weight: 700;
    text-transform: uppercase;
}

.pos-checkout-panel .pos-total-display #pos-total-display {
    color: var(--accent);
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
}

#pos-submit-btn {
    border-radius: 14px;
    font-size: 1.05rem !important;
    margin-top: 6px;
    min-height: 58px;
    width: 100%;
}

@media (max-width: 992px) {
    .pos-checkout-panel {
        min-height: auto;
    }
}

/* Pulse Animation for Low Stock Alert */
@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.alert-pulse-red {
    animation: pulse-red 2s infinite;
    border: 1px solid var(--danger);
    background-color: rgba(239, 68, 68, 0.15) !important;
}

/* Glassmorphism Login Backdrop */
.auth-bg {
    background: var(--auth-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-glass-card {
    background: var(--auth-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 440px;
    padding: 40px;
}

:root[data-theme="light"] .text-white,
:root[data-theme="light"] .text-light {
    color: var(--text-primary) !important;
}

:root[data-theme="light"] .text-secondary,
:root[data-theme="light"] .text-muted {
    color: var(--text-secondary) !important;
}

:root[data-theme="light"] .bg-dark,
:root[data-theme="light"] .bg-secondary {
    background-color: var(--bg-tertiary) !important;
}

:root[data-theme="light"] .border-secondary {
    border-color: var(--border-color) !important;
}

:root[data-theme="light"] .btn-close-white {
    filter: none;
}

:root[data-theme="light"] .list-group-item.bg-dark {
    background-color: var(--bg-secondary) !important;
}
