/*
 * Multi-Restaurant QR Menu Management System
 * Admin & Restaurant Dashboard Styles (Premium & State-of-the-Art)
 */

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

:root {
    --primary-color: #2c3e50;
    --accent-color: #e67e22;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #e67e22;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --font-sans: 'Inter', 'Cairo', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* RTL Layout support */
body[dir="rtl"] {
    font-family: 'Cairo', 'Inter', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    border-right: 1px solid rgba(255,255,255,0.05);
}

body[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
    padding: 24px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-color), #f39c12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
}

.sidebar-user {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background-color: rgba(0,0,0,0.15);
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 14px;
}

.sidebar-user .user-role {
    font-size: 12px;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
}

.sidebar-menu li a:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar-menu li.active a {
    background-color: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #f1f5f9;
}

.sidebar-footer a:hover {
    color: var(--danger-color);
}

/* Main Content Panel */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Navbar / Top bar */
.topbar {
    height: 70px;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Dashboard container */
.content-body {
    padding: 32px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Grid & Cards */
.grid {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card-title {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.card-footer-info {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
}

/* Table Style */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #fff;
    margin-bottom: 24px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

body[dir="rtl"] .table {
    text-align: right;
}

.table th {
    background-color: #f1f5f9;
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-info { background-color: #dbeafe; color: #1e40af; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-secondary {
    background-color: #fff;
    color: var(--text-color);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: #f1f5f9;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #fff;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Alert notifications */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* Login Page Styling */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(44, 62, 80, 1) 0%, rgba(30, 41, 59, 1) 90.1%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--accent-color), #f39c12);
    border-radius: 12px;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Custom Grid Columns for forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background-color: #fff;
}

.empty-state-icon {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.breadcrumbs li::after {
    content: "/";
    margin-left: 8px;
}

body[dir="rtl"] .breadcrumbs li::after {
    content: "\\";
    margin-right: 8px;
    margin-left: 0;
}

.breadcrumbs li:last-child::after {
    content: "";
}

.breadcrumbs a:hover {
    color: var(--accent-color);
}

/* QR Code Section styles */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    max-width: 320px;
    margin: 0 auto;
}

.qr-svg {
    width: 200px;
    height: 200px;
    background: #fff;
    padding: 8px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* Responsive Navigation Toggle for mobile admin */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .sidebar-menu {
        padding: 12px;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
    }
    .sidebar-user {
        display: none;
    }
}
