:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #10b981;
    --bg-color: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Glassmorphism utility */
.glassmorphism {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
}

/* Login Page specific */
.login-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--secondary);
    color: #fff;
}
.btn-success:hover {
    background: #059669;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background: rgba(30, 41, 59, 0.9);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 1.5rem;
}

.sidebar-header span {
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-links li a:hover, .nav-links li a.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.1);
    border-right: 4px solid var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--surface-border);
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--surface-border);
}

.content-area {
    padding: 2rem;
    flex-grow: 1;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Utilities */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Grid Layouts for POS */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    height: calc(100vh - 120px);
}

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

.pos-search {
    margin-bottom: 1rem;
}

.pos-search .form-control {
    font-size: 1.2rem;
    padding: 1rem;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    margin-bottom: 1rem;
}

.pos-summary {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    padding: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}
.summary-row.total {
    font-size: 1.5rem;
    color: #fff;
    font-weight: 700;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-border);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.stat-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.5rem;
}

/* Language Switcher Component */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 3px;
    gap: 4px;
}

.lang-btn {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lang-btn:hover {
    color: #fff;
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Urdu & RTL Styles */
html[dir="rtl"] body {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--surface-border);
}

html[dir="rtl"] .nav-links li a i {
    margin-left: 0.75rem;
    margin-right: 0;
}

html[dir="rtl"] .user-info {
    text-align: left;
}

html[dir="rtl"] .table th, 
html[dir="rtl"] .table td {
    text-align: right;
}

html[dir="rtl"] .table th:last-child, 
html[dir="rtl"] .table td:last-child {
    text-align: center;
}

html[dir="rtl"] .search-results {
    right: 0;
    left: auto;
}

