/* ==========================================================
   ProTax ERP — Dashboard
   ========================================================== */

.dashboard {
    padding: 28px 32px 40px;
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================
   Dashboard Header
   ========================================================== */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    margin: 0;
    color: #0F172A;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dashboard-header p {
    margin: 7px 0 0;
    color: #64748B;
    font-size: 14px;
    line-height: 1.5;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================
   Dashboard Grids
   ========================================================== */

.dashboard-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.dashboard-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid-3 {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.dashboard-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-span-2 {
    grid-column: span 1;
}

/* ==========================================================
   Dashboard Cards
   ========================================================== */

.dashboard-card {
    position: relative;
    min-width: 0;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 22px;
    box-sizing: border-box;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.045);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    border-color: #D7E0EA;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.075);
}

/* ==========================================================
   Statistics / KPI Cards
   ========================================================== */

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 118px;
}

.stat-icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #FFFFFF;
    font-size: 22px;
    line-height: 1;
}

.stat-icon.blue {
    background: #2563EB;
}

.stat-icon.green {
    background: #16A34A;
}

.stat-icon.orange {
    background: #EA580C;
}

.stat-icon.purple {
    background: #7C3AED;
}

.stat-title {
    margin: 0;
    color: #64748B;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}

.stat-number {
    margin: 4px 0 2px;
    color: #0F172A;
    font-size: 27px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-change {
    font-size: 11px;
    line-height: 1.4;
    font-weight: 500;
}

.stat-change.positive {
    color: #16A34A;
}

.stat-change.warning {
    color: #EA580C;
}

/* ==========================================================
   Card Header
   ========================================================== */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.card-header h3 {
    margin: 0;
    color: #0F172A;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 650;
}

.card-header a {
    color: #2563EB;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.card-header a:hover {
    text-decoration: underline;
}

/* ==========================================================
   Revenue Chart
   ========================================================== */

#revenueChart {
    width: 100%;
    min-height: 320px;
}

.chart-placeholder {
    min-height: 320px;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px dashed #CBD5E1;
    border-radius: 14px;

    background: #F8FAFC;
    color: #94A3B8;
    font-size: 13px;
}

/* ==========================================================
   Quick Actions
   ========================================================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-btn {
    min-height: 92px;
    border: 1px solid #EEF2F7;
    border-radius: 13px;

    background: #F8FAFC;
    color: #334155;

    padding: 16px 12px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;

    cursor: pointer;

    font-size: 12px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.quick-btn i {
    color: #2563EB;
    font-size: 22px;
    line-height: 1;
}

.quick-btn:hover {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.quick-btn:hover i {
    color: #FFFFFF;
}

/* ==========================================================
   Activity
   ========================================================== */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.activity-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #FFFFFF;
    font-size: 14px;
}

.activity-item strong {
    display: block;
    margin-bottom: 2px;

    color: #0F172A;
    font-size: 12px;
    line-height: 1.4;
}

.activity-item div:not(.activity-icon) {
    color: #475569;
    font-size: 11px;
    line-height: 1.45;
}

.activity-item small {
    display: block;
    margin-top: 2px;
    color: #94A3B8;
    font-size: 10px;
}

/* ==========================================================
   Tasks
   ========================================================== */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 9px 10px;

    border: 1px solid #EEF2F7;
    border-radius: 9px;

    color: #334155;
    background: #FAFBFC;

    font-size: 12px;
    line-height: 1.4;

    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.task-item:hover {
    background: #F8FAFC;
    border-color: #DCE5EF;
}

.task-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #2563EB;
}

/* ==========================================================
   Deadlines
   ========================================================== */

.deadline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deadline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 11px 12px;

    border: 1px solid #EEF2F7;
    border-radius: 10px;
    background: #FAFBFC;
}

.deadline-date {
    flex: 0 0 auto;
    color: #2563EB;
    font-size: 11px;
    font-weight: 700;
}

.deadline-title {
    flex: 1;
    color: #334155;
    font-size: 12px;
}

/* ==========================================================
   Announcements
   ========================================================== */

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.announcement-item {
    padding-bottom: 12px;
    border-bottom: 1px solid #EEF2F7;
}

.announcement-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.announcement-item h4 {
    margin: 0 0 4px;
    color: #0F172A;
    font-size: 12px;
    font-weight: 650;
}

.announcement-item p {
    margin: 0;
    color: #64748B;
    font-size: 11px;
    line-height: 1.5;
}

/* ==========================================================
   Empty States
   ========================================================== */

.activity-placeholder {
    min-height: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    background: #F8FAFC;

    color: #94A3B8;
    font-size: 13px;
}

/* ==========================================================
   Responsive — Large Tablet
   ========================================================== */

@media (max-width: 1200px) {

    .dashboard-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Responsive — Tablet
   ========================================================== */

@media (max-width: 900px) {

    .dashboard {
        padding: 24px;
    }

    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Responsive — Mobile
   ========================================================== */

@media (max-width: 640px) {

    .dashboard {
        padding: 18px;
    }

    .dashboard-header {
        align-items: flex-start;
    }

    .dashboard-header h1 {
        font-size: 26px;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-actions .erp-btn {
        flex: 1;
        justify-content: center;
    }

    .dashboard-grid-4 {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        padding: 18px;
        border-radius: 14px;
    }

    .stat-card {
        min-height: 105px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================
   Director Daily Return Tracker
   ========================================================== */

.director-daily-tracker {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #DDE7EC;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 7px 22px rgba(25, 45, 67, 0.055);
}

.ddt-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.ddt-header small {
    color: #087F80;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.ddt-header h2 {
    margin: 4px 0;
    color: #10213B;
    font-size: 23px;
}

.ddt-header p,
.ddt-source-card header p,
.ddt-activity-card header p {
    margin: 0;
    color: #708095;
    font-size: 11px;
}

.ddt-date-form {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: end;
    gap: 7px;
}

.ddt-date-form label {
    grid-column: 1 / -1;
    color: #526176;
    font-size: 9px;
    font-weight: 800;
}

.ddt-date-form input,
.ddt-date-form button,
.ddt-date-form a {
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid #DCE5EB;
    border-radius: 9px;
    padding: 8px 10px;
    background: #FFFFFF;
    color: #334155;
    font: inherit;
    font-size: 10px;
    text-decoration: none;
}

.ddt-date-form button {
    border-color: #078C8F;
    background: #078C8F;
    color: #FFFFFF;
    cursor: pointer;
    font-weight: 800;
}

.ddt-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 13px;
}

.ddt-kpis article {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 13px;
    border: 1px solid #E3EAF0;
    border-radius: 12px;
    background: #F9FBFC;
}

.ddt-kpis i,
.ddt-return-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #E4F6F4;
    color: #087F80;
}

.ddt-kpis span,
.ddt-kpis small,
.ddt-kpis b {
    display: block;
    min-width: 0;
}

.ddt-kpis small {
    overflow: hidden;
    color: #64748B;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ddt-kpis b {
    margin-top: 2px;
    color: #10213B;
    font-size: 20px;
}

.ddt-movement {
    margin-bottom: 13px;
    padding: 13px 15px;
    border: 1px solid #E3EAF0;
    border-radius: 13px;
    background: #F9FBFC;
}

.ddt-movement > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ddt-movement h3 {
    margin: 0 0 2px;
    color: #10213B;
    font-size: 12px;
}

.ddt-movement p {
    margin: 0;
    color: #718096;
    font-size: 9px;
}

.ddt-movement-totals {
    display: flex;
    gap: 7px;
}

.ddt-movement-totals span {
    padding: 6px 9px;
    border-radius: 9px;
    background: #E9F6F4;
    color: #39706E;
    font-size: 8px;
    white-space: nowrap;
}

.ddt-movement-totals b {
    color: #087F80;
    font-size: 13px;
}

.ddt-movement-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.ddt-movement-groups > span:not(.ddt-empty) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 1px solid #E6EDF1;
    border-radius: 9px;
    background: #FFFFFF;
}

.ddt-movement-groups strong,
.ddt-movement-groups small {
    display: block;
    min-width: 0;
}

.ddt-movement-groups strong {
    overflow: hidden;
    color: #24344A;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ddt-movement-groups small {
    margin-top: 1px;
    color: #8290A1;
    font-size: 7px;
}

.ddt-movement-groups em {
    color: #718096;
    font-size: 7px;
    font-style: normal;
    text-align: center;
}

.ddt-movement-groups em b {
    display: block;
    color: #087F80;
    font-size: 11px;
}

.ddt-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
    gap: 12px;
}

.ddt-grid > article {
    min-width: 0;
    padding: 15px;
    border: 1px solid #E3EAF0;
    border-radius: 13px;
    background: #FFFFFF;
}

.ddt-grid h3 {
    margin: 0 0 3px;
    color: #10213B;
    font-size: 14px;
}

.ddt-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.ddt-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    color: #334155;
    font-size: 10px;
}

.ddt-table-wrap th,
.ddt-table-wrap td {
    padding: 9px 7px;
    border-top: 1px solid #EDF1F4;
    text-align: center;
    white-space: nowrap;
}

.ddt-table-wrap th {
    border-top: 0;
    color: #718096;
    font-size: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ddt-table-wrap th:first-child,
.ddt-table-wrap td:first-child {
    text-align: left;
}

.ddt-table-wrap td:first-child strong,
.ddt-table-wrap td:first-child small {
    display: block;
}

.ddt-table-wrap td:first-child small {
    margin-top: 2px;
    color: #8290A1;
    font-size: 8px;
}

.ddt-table-wrap td a {
    color: #078C8F;
    font-size: 9px;
    font-weight: 800;
    text-decoration: none;
}

.ddt-table-wrap .needs-attention {
    color: #C86608;
    font-weight: 800;
}

.ddt-table-wrap .is-overdue {
    color: #C83737;
    font-weight: 800;
}

.ddt-activity-list {
    display: grid;
    margin-top: 8px;
}

.ddt-activity-list > a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-top: 1px solid #EDF1F4;
    color: #17263E;
    text-decoration: none;
}

.ddt-activity-list > a:first-of-type {
    border-top: 0;
}

.ddt-activity-list strong,
.ddt-activity-list small {
    display: block;
    min-width: 0;
}

.ddt-activity-list strong {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ddt-activity-list small {
    margin-top: 2px;
    color: #78879A;
    font-size: 8px;
}

.ddt-activity-list em {
    max-width: 110px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #EDF8F7;
    color: #087B79;
    font-size: 8px;
    font-style: normal;
    font-weight: 800;
    text-align: center;
}

.ddt-empty {
    padding: 18px 8px !important;
    color: #8190A3;
    text-align: center !important;
}

@media (max-width: 1200px) {
    .ddt-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

@media (max-width: 900px) {
    .ddt-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .director-daily-tracker {
        padding: 15px;
    }

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

    .ddt-date-form {
        width: 100%;
        grid-template-columns: 1fr auto auto;
    }

    .ddt-movement > header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ddt-movement-groups {
        grid-template-columns: 1fr;
    }

    .ddt-activity-list > a {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .ddt-activity-list > a > em {
        grid-column: 2;
        justify-self: start;
    }
}
