/* =========================================================
   GARMENT ERP - COMMON APPLICATION STYLES
   Version 1.0
   ========================================================= */

/* ---------- Basic Reset ---------- */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    color: #20252b;
    font-size: 14px;
}


/* ---------- Links ---------- */

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


/* ---------- Application Layout ---------- */

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


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

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #172033;
    color: #ffffff;
    flex-shrink: 0;
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 22px;
    font-size: 19px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-section {
    padding: 20px 14px 6px;
    color: #8e99aa;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 2px 10px;
    padding: 10px 12px;
    border-radius: 7px;
    color: #c8cfda;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.07);
    color: #ffffff;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
}


/* ---------- Main Application Area ---------- */

.app-main {
    flex: 1;
    min-width: 0;
}


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

.topbar {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #e7eaf0;

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

    padding: 0 28px;
}

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

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;

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

    background: #eef1f6;
    color: #394150;
    font-weight: 600;
}


/* ---------- Page Content ---------- */

.page-content {
    padding: 28px;
}

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

.page-heading h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
}

.page-heading p {
    margin: 0;
    color: #737b88;
}


/* ---------- Cards ---------- */

.card {
    background: #ffffff;
    border: 1px solid #e7eaf0;
    border-radius: 10px;
    padding: 20px;
}

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


/* ---------- Dashboard Metrics ---------- */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #e7eaf0;
    border-radius: 10px;
    padding: 20px;
}

.metric-label {
    color: #737b88;
    font-size: 13px;
    margin-bottom: 8px;
}

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

.metric-note {
    margin-top: 6px;
    color: #8a929f;
    font-size: 12px;
}


/* ---------- Tables ---------- */

.table-container {
    background: #ffffff;
    border: 1px solid #e7eaf0;
    border-radius: 10px;
    overflow-x: auto;
}

.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 #e7eaf0;
}

.data-table td {
    padding: 13px 15px;
    border-bottom: 1px solid #edf0f4;
    vertical-align: middle;
}

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

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


/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 6px;

    padding: 9px 15px;

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

    cursor: pointer;
}

.btn-primary {
    background: #26364f;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d2b40;
}

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

.btn-danger {
    background: #fbeaea;
    color: #a63d3d;
}


/* ---------- 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: 6px;

    background: #ffffff;
    color: #20252b;

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

.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;
}


/* ---------- Status Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 9px;

    border-radius: 20px;

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

.badge-active {
    background: #e8f5ed;
    color: #26734a;
}

.badge-warning {
    background: #fff4df;
    color: #94651b;
}

.badge-danger {
    background: #fbeaea;
    color: #a63d3d;
}


/* ---------- Action Buttons ---------- */

.action-group {
    display: flex;
    gap: 7px;
    align-items: center;
}


/* ---------- Responsive ---------- */

@media (max-width: 1000px) {

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

    .sidebar {
        width: 220px;
    }
}

@media (max-width: 700px) {

    .sidebar {
        width: 190px;
    }

    .topbar {
        padding: 0 16px;
    }

    .page-content {
        padding: 18px;
    }

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

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

/* ---------- Sidebar Dropdown Menus ---------- */

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

    padding: 10px 12px;

    border: none;
    border-radius: 7px;

    background: transparent;
    color: #c8cfda;

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

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

    cursor: pointer;
    text-align: left;
}

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

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

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

.dropdown-arrow {
    font-size: 11px;
    transition: transform 0.2s ease;
}

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


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

.sidebar-submenu {
    display: none;
}

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

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

    font-size: 13px;
}

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