﻿:root {
    --primary: #FF8400;
    /* REKORD Orange */
    --primary-dark: #CC6900;
    --primary-light: #F7DBC3;
    --primary-soft: #FFF4E6;
    --sidebar-bg: #ffffff;
    --accent: #FF8400;
    --danger: #FF8400;
    --danger-dark: #CC6900;
    --danger-bg: #FFF4E6;
    --danger-text: #CC6900;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #3D3833;
    --text-muted: #6b7280;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --glass: rgba(255, 255, 255, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
nav.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--text-main);
    padding: 2rem 0;
    /* Removed horizontal padding for full-width links */
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    border-right: 1px solid var(--border);
    transition: all 0.3s ease;
    z-index: 100;
}

.logo-area {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
}

.logo-area img {
    max-width: 140px;
    height: auto;
    margin-bottom: 0.5rem;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-links a.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* Main Content Area */
main.content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    width: calc(100% - 260px);
}

header.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: var(--shadow);
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    display: grid;
    place-items: center;
    font-weight: bold;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* Widgets */
.widget-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    flex: 1;
}

.widget {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.widget h2 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Table Style */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badge Styles */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.success {
    background: #d1fae5;
    color: #065f46;
}

.badge.warning {
    background: #ffedd5;
    color: #9a3412;
}

.badge.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge.info {
    background: #e0f2fe;
    color: #0369a1;
}

/* Mobile Navigation & Overlay */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    backdrop-filter: blur(2px);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    padding: 0.5rem;
    cursor: pointer;
}

/* Tablet & Mobile (Combined responsive layout) */
@media (max-width: 1024px) {
    .mobile-nav-toggle {
        display: block;
    }

    nav.sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1000;
        top: 0;
    }

    nav.sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    nav.sidebar .nav-links span {
        display: inline;
    }

    nav.sidebar .nav-links a {
        justify-content: flex-start;
        padding: 0.8rem 1.5rem;
    }

    nav.sidebar .logo-area img {
        max-width: 140px;
    }

    nav.sidebar .logo-area span {
        display: inline;
    }

    main.content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
        width: 100%;
    }

    header.top-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border);
        z-index: 50;
        margin-bottom: 0;
    }

    header.top-bar h1 {
        font-size: 1.25rem;
    }

    .user-profile span {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    .widget {
        overflow-x: auto;
        padding: 1rem;
        width: 100%;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* Samsung Z Fold Special Considerations (Square-ish unfolded ratio) */
@media (min-width: 600px) and (max-width: 900px) and (min-aspect-ratio: 1/1) {
    nav.sidebar {
        width: 70px;
    }

    main.content {
        margin-left: 70px;
    }
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.btn-secondary {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}