/* =========================
   GLOBAL BASE
   ========================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 12px;
}

/* =========================
   HEADER (TOP NAV)
   ========================= */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #ffffff;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
}

/* LEFT */
.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
}

.logo {
    font-size: 14px;
    font-weight: 700;
}

.tagline {
    font-size: 11px;
    color: #9ca3af;
}

/* CENTER */
.header-center {
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-center a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 3px;
}

.header-center a i {
    font-size: 13px;
    color: #6b7280;
}

.header-center a:hover {
    background: #f3f4f6;
    color: #1f6fb2;
}

.header-center a:hover i {
    color: #1f6fb2;
}

/* RIGHT */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #374151;
}

.logout-link {
    color: #6b7280;
    text-decoration: none;
}

.logout-link:hover {
    color: #ef4444;
}

/* =========================
   BODY
   ========================= */
.app-body {
    margin-top: 50px;
    margin-bottom: 32px;
    padding: 14px;
    max-width: 1350px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 82px);
}

/* =========================
   FOOTER
   ========================= */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    font-size: 11px;
    color: #9ca3af;
}

/* =========================
   PAGE TITLE STRIP (GLOBAL)
   ========================= */
.page-header {
    background: #f3f4f6;
    border-bottom: 1px solid #d1d5db;
    padding: 10px 16px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.page-actions a {
    margin-left: 6px;
}

/* =========================
   PAGE CONTAINER
   ========================= */
.page-box {
    background: #ffffff;
    border: 1px solid #d1d5db;
    padding: 14px 16px;
}

/* =========================
   BUTTONS
   ========================= */
.btn-primary,
.btn-save {
    background: #1f6fb2;
    color: #ffffff;
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid #155a8a;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover,
.btn-save:hover {
    background: #155a8a;
}

.btn-view {
    font-size: 11px;
    padding: 3px 10px;
    border: 1px solid #b6c6de;
    background: #ffffff;
    color: #1f6fb2;
    text-decoration: none;
}

.btn-view:hover {
    background: #eef4fb;
}

/* =========================
   ERP TABLE
   ========================= */
.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.erp-table th {
    padding: 5px 10px;
    background: #eef4fb;
    color: #1f3a5f;
    font-weight: 600;
    border-bottom: 1px solid #c7d6ea;
    text-align: left;
}

.erp-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.erp-table tr:hover {
    background: #f5f8fc;
}

.action-col {
    width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* =========================
   LIST FILTER
   ========================= */
.erp-list-filter form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.erp-list-filter label {
    font-size: 11px;
    color: #6b7280;
}

.erp-list-filter input {
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    width: 200px;
}

/* =========================
   PAGINATION
   ========================= */
.erp-pagination {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
}

.page-link {
    padding: 3px 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
}

.page-link.active {
    background: #1f6fb2;
    color: #ffffff;
    border-color: #1f6fb2;
    font-weight: 600;
}

/* =========================
   STATUS COLORS
   ========================= */
.status-active { color: #166534; font-weight: 600; }
.status-hold { color: #92400e; font-weight: 600; }
.status-completed { color: #1e40af; font-weight: 600; }

/* =========================
   ERP FORM SYSTEM (FINAL)
   ========================= */
.erp-form-container {
    max-width: 1150px;
    margin: 0 auto 30px auto;
}

.erp-form-block {
    background: #ffffff;
    border: 1px solid #d1d5db;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.erp-form-title {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    margin: -14px -16px 14px -16px;
}

.form-grid {
    display: grid;
    gap: 14px 18px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    color: #374151;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
}

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* =========================
   UTILITIES
   ========================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #6b7280; font-size: 11px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }

/* =========================
   HEADER DROPDOWN (ERP STYLE)
   ========================= */

.nav-dropdown {
    position: relative;
}

.nav-parent {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    text-decoration: none;
    color: #374151;
    border-radius: 3px;
}

.nav-parent:hover {
    background: #f3f4f6;
    color: #1f6fb2;
}

.nav-caret {
    font-size: 10px;
    margin-left: 2px;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    z-index: 1001;
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    font-size: 12px;
    color: #374151;
    text-decoration: none;
}

.nav-dropdown-menu a:hover {
    background: #eef4fb;
    color: #1f6fb2;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.erp-tabs {
    display: flex;
    gap: 14px;
    border-bottom: 1px solid #d1d5db;
    margin-bottom: 12px;
    padding-left: 0;
    list-style: none;
}

.erp-tabs li {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
}

.erp-tabs li.active {
    color: #1f6fb2;
    border-bottom: 2px solid #1f6fb2;
    font-weight: 600;
}

.erp-tab-content {
    display: none;
}

.erp-tab-content.active {
    display: block;
}

.erp-kpi-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 12px;
}

.erp-kpi-card .kpi-value {
    font-size: 16px;
    font-weight: 700;
    margin-top: 4px;
}

.erp-kpi-card.highlight {
    background: #eef4fb;
    border-color: #c7d6ea;
}


.app-header .header-center a.active {
    background: #e0e7ff;
    color: #1e40af;
}

