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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f5f7;
    color: #1f2937;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        linear-gradient(135deg, #111827 0%, #263445 55%, #374151 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 14px;
    padding: 42px;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.25);
}

.login-brand {
    text-align: center;
    margin-bottom: 34px;
}

.brand-mark {
    width: 92px;
    height: 64px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: white;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 2px;
    border-radius: 8px;
}

.login-brand h1 {
    font-size: 25px;
    margin-bottom: 7px;
}

.login-brand p {
    color: #6b7280;
    font-size: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 15px;
    outline: none;
}

.form-group input:focus {
    border-color: #374151;
    box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.12);
}

.btn-primary {
    width: 100%;
    border: 0;
    border-radius: 7px;
    padding: 14px;
    background: #111827;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary:hover {
    background: #263445;
}

.alert {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 7px;
    font-size: 14px;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.login-footer span {
    font-size: 11px;
    color: #9ca3af;
}

@media (max-width: 520px) {
    .login-card {
        padding: 30px 22px;
    }

    .login-brand h1 {
        font-size: 22px;
    }
}

.login-logo {
    display: block;
    width: 210px;
    max-width: 85%;
    height: auto;
    margin: 0 auto 18px;
    object-fit: contain;
}

@media (max-width: 520px) {
    .login-logo {
        width: 180px;
    }
}

.app-page {
    min-height: 100vh;
    background: #f4f5f7;
}

.app-header {
    min-height: 82px;
    padding: 14px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-brand img {
    width: 115px;
    height: 52px;
    object-fit: contain;
}

.header-brand h1 {
    font-size: 22px;
    margin-bottom: 3px;
}

.header-brand p {
    font-size: 13px;
    color: #6b7280;
}

.project-form {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto;
}

.form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.form-card h2 {
    font-size: 17px;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid #c5a253;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
}

.field-wide {
    grid-column: span 2;
}

.field label {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #b08b3e;
    box-shadow: 0 0 0 3px rgba(176, 139, 62, .12);
}

.financial-card {
    border-top: 3px solid #c5a253;
}

.money-input {
    display: flex;
    align-items: center;
}

.money-input span {
    padding: 11px 13px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-right: 0;
    border-radius: 6px 0 0 6px;
}

.money-input input {
    border-radius: 0 6px 6px 0;
}

.form-help {
    margin-top: 18px;
    color: #6b7280;
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 25px 0 40px;
}

.btn-save,
.btn-secondary,
.btn-cancel {
    text-decoration: none;
    border-radius: 6px;
    padding: 11px 20px;
    font-weight: 700;
    font-size: 14px;
}

.btn-save {
    border: 0;
    background: #111827;
    color: white;
    cursor: pointer;
}

.btn-save:hover {
    background: #c5a253;
    color: #111827;
}

.btn-secondary {
    background: #111827;
    color: white;
}

.btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

.app-footer {
    padding: 25px;
    text-align: center;
    color: #9ca3af;
    font-size: 11px;
}

@media (max-width: 850px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .field-wide {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .app-header {
        padding: 12px 16px;
    }

    .header-brand img {
        width: 85px;
    }

    .header-brand h1 {
        font-size: 17px;
    }

    .header-brand p {
        display: none;
    }

    .project-form {
        width: calc(100% - 20px);
        margin-top: 12px;
    }

    .form-card {
        padding: 18px;
    }

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

    .field-wide {
        grid-column: span 1;
    }

    .form-actions {
        position: sticky;
        bottom: 0;
        background: #f4f5f7;
        padding: 12px 0;
    }

    .btn-save {
        flex: 1;
    }
}

/* =====================================================
   ANM PROJECT MANAGEMENT DASHBOARD
   ===================================================== */

.dashboard-layout {
    min-height: 100vh;
    display: flex;
    background: #f4f5f7;
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #111820;
    color: #ffffff;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid #28313b;
    text-align: center;
}

.sidebar-logo img {
    width: 145px;
    max-height: 68px;
    object-fit: contain;
}

.sidebar-logo span {
    display: block;
    margin-top: 8px;
    font-size: 9px;
    letter-spacing: 2px;
    color: #c5a253;
    font-weight: 700;
}

.sidebar-nav {
    padding: 18px 12px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: 6px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 14px;
    transition: .2s;
}

.sidebar-nav a:hover {
    background: #202a35;
    color: white;
}

.sidebar-nav a.active {
    background: #c5a253;
    color: #111820;
    font-weight: 700;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-weight: 700;
}

.nav-divider {
    height: 1px;
    background: #28313b;
    margin: 14px 6px;
}

.sidebar-footer {
    border-top: 1px solid #28313b;
    padding: 18px 20px;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
}

.user-role {
    font-size: 11px;
    color: #c5a253;
    margin: 3px 0 10px;
}

.sidebar-footer a {
    color: #cbd5e1;
    font-size: 12px;
    text-decoration: none;
}

.sidebar-footer small {
    display: block;
    color: #64748b;
    font-size: 9px;
    margin-top: 18px;
    line-height: 1.5;
}

.dashboard-main {
    flex: 1;
    margin-left: 250px;
    padding: 28px 32px 50px;
    min-width: 0;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.dashboard-topbar h1 {
    font-size: 28px;
    color: #111827;
}

.dashboard-topbar p {
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
}

.new-project-btn {
    background: #c5a253;
    color: #111820;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
}

.new-project-btn:hover {
    background: #b69245;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    border-top: 3px solid #c5a253;
}

.kpi-card.attention {
    border-top-color: #b91c1c;
}

.kpi-label {
    font-size: 10px;
    letter-spacing: 1px;
    color: #6b7280;
    font-weight: 800;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 8px 0 4px;
}

.kpi-note {
    font-size: 11px;
    color: #9ca3af;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 20px;
}

.dashboard-grid .dashboard-panel {
    margin-bottom: 0;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.panel-heading h2 {
    font-size: 16px;
    color: #111827;
}

.panel-heading p {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.panel-count {
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
}

.panel-link {
    color: #9a772e;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.empty-state {
    min-height: 145px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #9ca3af;
    text-align: center;
}

.empty-state strong {
    color: #4b5563;
    font-size: 13px;
    margin: 6px 0;
}

.empty-state p {
    font-size: 11px;
}

.empty-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c5a253;
    font-weight: 800;
}

.empty-state.compact {
    min-height: 60px;
}

.schedule-panel {
    overflow: hidden;
}

.schedule-placeholder {
    overflow-x: auto;
}

.timeline-header {
    min-width: 700px;
    display: grid;
    grid-template-columns: 220px repeat(5, 1fr);
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.timeline-header span {
    padding: 10px;
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    border-right: 1px solid #e5e7eb;
    text-align: center;
}

.timeline-header span:first-child {
    text-align: left;
}

.empty-schedule {
    min-width: 700px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-top: 0;
    color: #9ca3af;
    font-size: 12px;
}

@media (max-width: 1000px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 700px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-logo {
        padding: 18px 8px;
    }

    .sidebar-logo img {
        width: 55px;
    }

    .sidebar-logo span,
    .sidebar-nav a:not(.active) span + *,
    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        padding: 15px 8px;
    }

    .sidebar-nav a {
        justify-content: center;
        padding: 13px 8px;
        font-size: 0;
    }

    .sidebar-nav .nav-icon {
        font-size: 18px;
    }

    .dashboard-main {
        margin-left: 70px;
        padding: 18px 12px 40px;
    }

    .dashboard-topbar h1 {
        font-size: 21px;
    }

    .dashboard-topbar p {
        display: none;
    }

    .new-project-btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-value {
        font-size: 22px;
    }
}

/* =====================================================
   PROJECTS
   ===================================================== */

.project-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.project-summary {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #c5a253;
    border-radius: 7px;
    padding: 16px 18px;
}

.project-summary span {
    display: block;
    color: #6b7280;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.project-summary strong {
    display: block;
    margin-top: 5px;
    font-size: 22px;
    color: #111827;
}

.project-toolbar {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.project-search {
    flex: 1;
}

.project-search input,
.project-toolbar select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 13px;
}

.project-toolbar select {
    max-width: 210px;
}

.projects-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.projects-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
}

.projects-table th {
    padding: 10px 12px;
    text-align: left;
    background: #f8fafc;
    border-bottom: 1px solid #dfe3e8;
    color: #64748b;
    font-size: 9px;
    letter-spacing: .7px;
}

.projects-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf0f2;
    color: #374151;
    font-size: 12px;
    vertical-align: middle;
}

.projects-table tbody tr:hover {
    background: #fafafa;
}

.projects-table td strong {
    display: block;
    color: #111827;
}

.projects-table td small {
    display: block;
    margin-top: 4px;
    color: #9ca3af;
    font-size: 10px;
}

.job-number {
    color: #9a772e !important;
}

.money-cell {
    font-weight: 700;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 20px;
    background: #f3f4f6;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

.status-on-hold {
    background: #fee2e2;
    color: #991b1b;
}

.status-estimating {
    background: #fef3c7;
    color: #92400e;
}

.progress-line {
    width: 85px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #c5a253;
    border-radius: 10px;
}

.projects-empty {
    padding: 70px 20px;
    text-align: center;
}

.projects-empty-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 15px;
    background: #f3f4f6;
    color: #c5a253;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.projects-empty h2 {
    font-size: 18px;
    margin-bottom: 7px;
}

.projects-empty p {
    color: #9ca3af;
    font-size: 12px;
    margin-bottom: 22px;
}

@media (max-width: 700px) {
    .project-summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 7px;
    }

    .project-summary {
        padding: 11px;
    }

    .project-summary strong {
        font-size: 18px;
    }

    .project-toolbar {
        flex-direction: column;
    }

    .project-toolbar select {
        max-width: none;
    }
}

.project-link {
    text-decoration: none;
    font-weight: 800;
}

.project-link:hover {
    text-decoration: underline;
}

/* =====================================================
   PROJECT WORKSPACE
   ===================================================== */

.project-breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    margin-bottom: 16px;
    color: #9ca3af;
}

.project-breadcrumb a {
    color: #9a772e;
    text-decoration: none;
}

.project-workspace-header {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 22px;
}

.workspace-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workspace-title-row h1 {
    font-size: 28px;
}

.project-workspace-header h2 {
    margin-top: 5px;
    font-size: 17px;
    color: #4b5563;
}

.project-workspace-header p {
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

.workspace-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.workspace-action-btn,
.small-action-btn {
    border: 0;
    border-radius: 6px;
    background: #111820;
    color: white;
    padding: 10px 15px;
    font-weight: 700;
    cursor: pointer;
}

.small-action-btn {
    padding: 8px 12px;
    font-size: 11px;
}

.workspace-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.workspace-kpi {
    background: white;
    border: 1px solid #e5e7eb;
    border-top: 3px solid #c5a253;
    border-radius: 8px;
    padding: 16px;
}

.workspace-kpi.workspace-warning {
    border-top-color: #b45309;
}

.workspace-kpi span {
    display: block;
    color: #6b7280;
    font-size: 9px;
    letter-spacing: .8px;
    font-weight: 800;
}

.workspace-kpi strong {
    display: block;
    margin-top: 7px;
    color: #111827;
    font-size: 21px;
}

.workspace-kpi small {
    display: block;
    margin-top: 5px;
    color: #9ca3af;
    font-size: 9px;
}

.workspace-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 9px;
}

.workspace-progress div {
    height: 100%;
    background: #c5a253;
}

.project-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    padding: 0 8px;
    margin-bottom: 18px;
}

.project-tab {
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 15px 13px 12px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.project-tab:hover {
    color: #111827;
}

.project-tab.active {
    color: #111827;
    border-bottom-color: #c5a253;
}

.project-tab-content {
    display: none;
}

.project-tab-content.active {
    display: block;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.workspace-grid .dashboard-panel {
    margin-bottom: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.detail-grid > div span {
    display: block;
    color: #9ca3af;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-grid > div strong {
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.detail-wide {
    grid-column: span 2;
}

.module-empty {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #9ca3af;
}

.module-empty strong {
    color: #4b5563;
    font-size: 13px;
}

.module-empty p {
    font-size: 11px;
    margin-top: 6px;
}

.activity-row {
    padding: 13px 0;
    border-bottom: 1px solid #edf0f2;
}

.activity-row strong {
    display: block;
    font-size: 12px;
}

.activity-row span {
    display: block;
    margin-top: 3px;
    color: #9ca3af;
    font-size: 9px;
}

.activity-row p {
    margin-top: 5px;
    color: #6b7280;
    font-size: 11px;
}

@media (max-width: 950px) {
    .workspace-kpis {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 600px) {
    .project-workspace-header {
        flex-direction: column;
    }

    .workspace-title-row h1 {
        font-size: 22px;
    }

    .workspace-actions {
        width: 100%;
    }

    .workspace-actions a,
    .workspace-actions button {
        flex: 1;
        text-align: center;
    }

    .workspace-kpis {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .workspace-kpi {
        padding: 12px;
    }

    .workspace-kpi strong {
        font-size: 17px;
    }

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

    .detail-wide {
        grid-column: span 1;
    }
}
