/**
 * Toronto Admin Panel - Styles
 * Dark Orange Theme
 */

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

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

html {
    zoom: 0.9;
}

:root {
    --bg: #0a0a0a;
    --bg-secondary: #0f0f0f;
    --card: #141414;
    --input: #1f1f1f;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);

    --accent: #FF5A1F;
    --accent-light: #FF8C3B;
    --accent-dark: #E04D15;
    --accent-glow: rgba(255, 90, 31, 0.3);

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    --text: #fff;
    --text-secondary: #e0e0e0;
    --muted: #9CA3AF;

    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ========================================
   LOGIN & SELECT LOCATION SCREENS
======================================== */

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at top, #141414 0%, #0a0a0a 100%);
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.auth-logo-icon svg {
    width: 40px;
    height: 40px;
}

.auth-logo-text {
    font-family: 'Unbounded', sans-serif;
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.auth-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    color: var(--muted);
}

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--card);
    border-color: var(--accent);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Location Items */
.location-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--glass);
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.location-item:hover {
    border-color: var(--accent);
    transform: translateX(6px);
    background: rgba(255, 90, 31, 0.08);
    box-shadow: 0 4px 20px rgba(255, 90, 31, 0.15);
}

.location-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.location-icon.store {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.location-icon.store::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4v2h16V4zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6h1zm-9 4H6v-4h6v4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.location-icon.all {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
}

.location-icon.all::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.location-info {
    flex: 1;
    min-width: 0;
}

.location-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.location-address {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

.location-arrow {
    color: var(--muted);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.location-item:hover .location-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* User Badge */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--glass);
    border-radius: 24px;
    font-size: 13px;
    color: var(--muted);
    margin-top: 20px;
}

.user-badge .avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #000;
}

/* Alert Messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-icon {
    font-size: 18px;
}

/* ========================================
   DASHBOARD & MAIN LAYOUT
======================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0E0E0E;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 12px 24px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.sidebar-logo-text {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--accent);
}

.nav-section {
    margin-bottom: 12px;
}

.nav-label {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 14px;
    margin-bottom: 6px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    margin-bottom: 2px;
    text-decoration: none;
    position: relative;
    opacity: 0.65;
}

.nav-item:hover {
    background: var(--glass);
    color: var(--text);
    opacity: 1;
}

.nav-item.active {
    background: rgba(255, 90, 31, 0.15);
    color: var(--accent);
    opacity: 1;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-dark));
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    background: var(--error);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.nav-badge.warn {
    background: var(--warning);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    margin-top: 60px;
    padding: 20px 24px 24px;
    min-height: 100vh;
}

/* Page Header Styles */
.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header .subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-weight: 600;
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.stat-icon.orange {
    background: rgba(255, 90, 31, 0.15);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.15);
}

.stat-value {
    font-family: 'Unbounded', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
}

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

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

.table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

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

.table tr:hover td {
    background: var(--glass);
}

/* Status Badges */
.status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.role-owner {
    background: rgba(255, 90, 31, 0.15);
    color: var(--accent);
}

.role-manager {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
}

.role-cashier {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
}

.role-cook {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--muted);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-3 {
    gap: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .auth-box {
        max-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #2a2a2a;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #2a2a2a;
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #2a2a2a;
}
