/* =========================================================
   VEEV GARMENT ERP
   Common Application Styles
   Version 2.0
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================================
   1. DESIGN VARIABLES
   ========================================================= */

:root {
    --sidebar-width: 250px;

    --sidebar-bg: #0f172a;
    --sidebar-text: #c8cfda;
    --sidebar-muted: #8e99aa;
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --sidebar-active: rgba(255, 255, 255, 0.10);

    --primary: #2563eb;
    --primary-hover: #1d4ed8;

    --page-bg: #f5f7fa;
    --card-bg: #ffffff;

    --text: #20252b;
    --text-muted: #737b88;
    --text-light: #8a929f;

    --border: #e7eaf0;
    --border-light: #edf0f4;

    --success-bg: #e8f5ed;
    --success-text: #26734a;

    --warning-bg: #fff4df;
    --warning-text: #94651b;

    --danger-bg: #fbeaea;
    --danger-text: #a63d3d;

    --radius-sm: 6px;
    --radius-md: 10px;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
}


/* =========================================================
   2. BASIC RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--page-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

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

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   3. APPLICATION LAYOUT
   ========================================================= */

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

.app-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}


/* =========================================================
   4. SIDEBAR
   ========================================================= */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;

    background: var(--sidebar-bg);
    color: #ffffff;

    overflow-y: auto;
    overflow-x: hidden;

    z-index: 1000;

    scrollbar-width: thin;
}


/* ---------- Sidebar Branding ---------- */

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 24px 15px 25px;

    text-align: center;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 72px;
    height: 72px;

    object-fit: contain;
    display: block;

    margin-bottom: 8px;
}

.sidebar-brand-name {
    color: #ffffff;

    font-size: 25px;
    font-weight: 700;

    line-height: 1.1;
    letter-spacing: 1px;
}

.sidebar-brand-subtitle {
    margin-top: 5px;

    color: #22a7e8;

    font-size: 13px;
    font-weight: 500;

    letter-spacing: 0.3px;
}


/* =========================================================
   5. SIDEBAR SECTIONS
   ========================================================= */

.sidebar-section {
    padding: 18px 14px 5px;

    color: var(--sidebar-muted);

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.sidebar-section-title {
    margin-bottom: 7px;
}


/* =========================================================
   6. SIDEBAR LINKS
   ========================================================= */

.sidebar-link {
    display: flex;
    align-items: center;

    gap: 11px;

    margin: 2px 10px;
    padding: 9px 12px;

    border-radius: 7px;

    color: var(--sidebar-text);

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #ffffff;
}


/* ---------- Sidebar Icons ---------- */

.sidebar-icon {
    width: 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    font-size: 13px;
}


/* =========================================================
   7. SIDEBAR DROPDOWN MENUS
   ========================================================= */

.sidebar-dropdown {
    width: calc(100% - 20px);

    margin: 2px 10px;
    padding: 9px 12px;

    border: none;
    border-radius: 7px;

    background: transparent;
    color: var(--sidebar-text);

    display: flex;
    align-items: center;
    justify-content: space-between;

    font-family: inherit;
    font-size: 14px;

    cursor: pointer;
    text-align: left;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.sidebar-dropdown:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-dropdown.open {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}


/* ---------- Dropdown Left Area ---------- */

.dropdown-left {
    display: flex;
    align-items: center;
    gap: 11px;
}


/* ---------- Dropdown Arrow ---------- */

.dropdown-arrow {
    font-size: 11px;

    transition: transform 0.2s ease;
}

.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}


/* ---------- Submenus ---------- */

.sidebar-submenu {
    display: none;
    text-transform: none;
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-submenu .sidebar-link {
    margin-left: 25px;
    padding-left: 12px;

    font-size: 14px;
    font-weight: 400;

    text-transform: none;
    letter-spacing: normal;

    color: var(--sidebar-text);
}

.sidebar-submenu .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* =========================================================
   8. TOP BAR
   ========================================================= */

.topbar {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 24px;
    box-sizing: border-box;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}


/* ---------- Top Bar Right ---------- */

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}


/* ---------- Notification ---------- */

.notification {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    cursor: pointer;
}

.notification-icon {
    font-size: 18px;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;

    min-width: 16px;
    height: 16px;

    padding: 0 4px;

    border-radius: 10px;

    background: #ef4444;
    color: #ffffff;

    font-size: 10px;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
}


/* ---------- User Menu ---------- */

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;

    cursor: pointer;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    line-height: 1.3;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-avatar {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    background: #eef2f7;
    color: #475569;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   9. PAGE CONTENT
   ========================================================= */

.page-content {
    padding: 28px;
}

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 0 0 6px;

    font-size: 24px;
    font-weight: 600;

    line-height: 1.25;
}

.page-heading p {
    margin: 0;

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


/* =========================================================
   10. CARDS
   ========================================================= */

.card {
    background: var(--card-bg);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    padding: 20px;

    box-shadow: var(--shadow-sm);
}

.card-title {
    margin: 0 0 16px;

    font-size: 16px;
    font-weight: 600;
}


/* =========================================================
   11. DASHBOARD METRICS
   ========================================================= */

.metrics-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 22px;
}

.metric-card {
    background: var(--card-bg);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    padding: 20px;

    box-shadow: var(--shadow-sm);
}

.metric-label {
    color: var(--text-muted);

    font-size: 13px;

    margin-bottom: 8px;
}

.metric-value {
    font-size: 26px;
    font-weight: 600;

    line-height: 1.2;
}

.metric-note {
    margin-top: 6px;

    color: var(--text-light);

    font-size: 12px;
}


/* =========================================================
   12. TABLES
   ========================================================= */

.table-container {
    background: var(--card-bg);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    overflow-x: auto;

    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;

    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fb;

    color: #646d7a;

    font-size: 12px;
    font-weight: 600;

    text-align: left;

    padding: 13px 15px;

    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 13px 15px;

    border-bottom: 1px solid var(--border-light);

    vertical-align: middle;
}

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

.data-table tr:hover td {
    background: #fafbfc;
}


/* =========================================================
   13. BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    border: none;
    border-radius: var(--radius-sm);

    padding: 9px 15px;

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.btn:active {
    transform: translateY(1px);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #eef1f5;
    color: #394150;
}

.btn-secondary:hover {
    background: #e3e7ed;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.btn-danger:hover {
    background: #f7dddd;
}


/* =========================================================
   14. FORMS
   ========================================================= */

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 500;

    color: #4d5663;
}

.form-control {
    width: 100%;

    padding: 10px 12px;

    border: 1px solid #d9dee6;
    border-radius: var(--radius-sm);

    background: #ffffff;
    color: var(--text);

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;

    border-color: #71809a;

    box-shadow:
        0 0 0 2px rgba(113, 128, 154, 0.12);
}

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


/* =========================================================
   15. STATUS BADGES
   ========================================================= */

.badge {
    display: inline-flex;

    align-items: center;

    padding: 4px 9px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 600;
}

.badge-active {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}


/* =========================================================
   16. ACTION BUTTON GROUP
   ========================================================= */

.action-group {
    display: flex;

    align-items: center;

    gap: 7px;
}


/* =========================================================
   17. RESPONSIVE - TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 230px;
    }

    .topbar {
        padding: 0 22px;
    }

    .page-content {
        padding: 22px;
    }

    .metrics-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   18. RESPONSIVE - SMALL TABLET
   ========================================================= */

@media (max-width: 800px) {

    :root {
        --sidebar-width: 210px;
    }

    .page-content {
        padding: 18px;
    }

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


/* =========================================================
   19. RESPONSIVE - PHONE
   ========================================================= */

@media (max-width: 600px) {

    :root {
        --sidebar-width: 190px;
    }

    .topbar {
        padding: 0 16px;
    }

    .page-content {
        padding: 16px;
    }

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

    .page-heading h1 {
        font-size: 21px;
    }
}