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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    font-size: 24px;
}

/* Container Layout */
.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

header {
    grid-column: 1 / -1;
    background: #667eea;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Accordion Sidebar */

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li {
    margin: 2px 0;
}

.sidebar a,
.accordion-btn {

    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;

    padding: 12px 18px;

    color: black;
    background: none;
    border: none;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: .25s;
    box-sizing: border-box;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar a i,
.menu-left i {
    width: 18px;
    text-align: center;
}

.sidebar a:hover,
.accordion-btn:hover {
    background: white;
}

.sidebar a.active {
    background: rgba(255, 255, 255, .12);
    border-left: 4px solid #4F8CFF;
    font-weight: 600;
}

.arrow {
    transition: .3s;
    font-size: 13px;
    margin-left: auto;
}

.accordion.active .arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    background: #F5F5F5;
}

.accordion.active .submenu {
    display: block;
}

.submenu a {
    padding: 11px 18px 11px 48px;
    font-size: 14px;
    color: black;
}

.submenu a:hover {
    background: white;
}

main {
    padding: 20px;
    background: #f5f5f5;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;

    width: 550px;
    max-width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-container h3 {
    margin-bottom: 15px;
    color: #667eea;
}

/* Buttons */
.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Export Buttons */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.btn-export {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-export-excel {
    background: #217346;
    color: white;
}

.btn-export-excel:hover {
    background: #1a5c38;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 115, 70, 0.3);
}

.btn-export-pdf {
    background: #dc2626;
    color: white;
}

.btn-export-pdf:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Tables */
table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

table thead {
    background: #667eea;
    color: white;
}

table th,
table td {
    padding: 12px;
    text-align: left;
}

table tbody tr {
    border-bottom: 1px solid #eee;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table td button {
    padding: 6px 10px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

table td button:hover {
    opacity: 0.8;
}

/* Dashboard Cards */
.dashboard-content {
    padding: 20px;
}


.dashboard-content h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

/* Permissions Section */
.permissions-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.permissions-section h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.permission-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.permission-grid input[type="checkbox"] {
    width: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.filters input {
    width: 100%;
    box-sizing: border-box;
    padding: 4px;
    font-size: 12px;
}

/* ==========================
   DataTable
========================== */


/* Prevent the page from overflowing */
.dataTables_wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

#dscTable {
    width: 100% !important;
}

/* Compact, readable table */
#dscTable th,
#dscTable td {
    padding: 5px 8px !important;
    font-size: 13px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Header */
#dscTable thead th {
    font-weight: 600;
    font-size: 13px;
}

/* Column filters */
.filters input {
    width: 100%;
    min-width: 85px;
    height: 30px;
    padding: 4px 6px;
    font-size: 12px;
    box-sizing: border-box;
}

/* Pagination controls */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_length {
    font-size: 13px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #95a5a6;
}

.close:hover {
    color: #e74c3c;
}

.issue-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.issue-section h3 {
    margin-bottom: 15px;
    color: #667eea;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

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

/* Admin Only Elements */
.admin-only {
    display: none;
}

/* Celebration Section */
.celebration-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-celebration {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(240, 147, 251, 0.4);
    animation: pulse 2s infinite;
}

.btn-celebration:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(240, 147, 251, 0.6);
}

.btn-celebration:active {
    transform: translateY(-2px) scale(1.02);
}



@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 6px 15px rgba(240, 147, 251, 0.4);
    }

    50% {
        box-shadow: 0 6px 25px rgba(240, 147, 251, 0.7);
    }
}

@keyframes celebrationText {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===========================
   TABLETS
=========================== */
@media (max-width: 992px) {

    header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .container {
        grid-template-columns: 220px 1fr;
    }

    .dashboard-wrapper,
    main {
        padding: 15px;
    }

    .dashboard-cards,
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        width: 95%;
    }

}


/* ===========================
   MOBILE
=========================== */

@media (max-width:768px) {

    .container {
        display: block;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .sidebar {
        width: 100%;
        padding: 0;
    }

    .sidebar ul {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
    }

    .sidebar li {
        flex: 0 0 auto;
    }

    .sidebar a {
        border-left: none !important;
    }

    main,
    .dashboard-wrapper {
        padding: 12px;
    }

    .dashboard-cards,
    .stats-row {
        grid-template-columns: 1fr;
    }

    .content-header {
        flex-direction: column;
        align-items: stretch;
    }

    .export-buttons {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary,
    .btn-export {
        width: 100%;
    }

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

    .modal-content {
        width: 98%;
        padding: 18px;
        max-height: 95vh;
    }

    table.dataTable {
        font-size: 12px;
    }

    .filters input {
        min-width: 70px;
        height: 28px;
        font-size: 12px;
    }

}


/* ===========================
   SMALL PHONES
=========================== */

@media (max-width:480px) {

    header h1 {
        font-size: 20px;
    }

    .dashboard-header h2 {
        font-size: 22px;
    }

    .stat-card {
        padding: 18px;
    }

    .card {
        padding: 18px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-export {
        font-size: 14px;
    }

}

/* Workflow status badge colors; existing layout and theme remain unchanged. */
.status-inoffice {
    background-color: #28a745;
}

.status-pendingacceptance {
    background-color: #0d6efd;
}

.status-withteam {
    background-color: #f0ad4e;
}

.status-withclient {
    background-color: #764ba2;
}

/* Keep text intact when it wraps. Words should break at whitespace, never
   between individual characters (for example, PendingAcceptance). */
body,
body * {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

/* Phase 2 visual system: compact ERP-style spacing using the existing palette. */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 20px;
}

header h1 {
    font-size: 21px;
}

.sidebar {
    position: sticky;
    top: 63px;
    height: calc(100vh - 63px);
    overflow-y: auto;
}

.sidebar a,
.accordion-btn {
    padding: 9px 16px;
    font-size: 14px;
}

.content {
    padding-top: 14px;
    padding-bottom: 20px;
}

.content-header {
    margin-bottom: 12px;
}

.btn-primary,
.btn-secondary,
.btn-export {
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 13px;
}

table {
    border-radius: 6px;
}

table th,
table td {
    padding: 8px 10px;
    font-size: 13px;
}

table thead th {
    height: 34px;
}

table tbody tr {
    height: 34px;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
}

.drilldown-table {
    border-collapse: collapse;
    box-shadow: none;
}

.drilldown-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.drilldown-table th,
.drilldown-table td {
    padding: 8px 10px;
    font-size: 13px;
}

.empty-state {
    display: block;
    padding: 18px;
    color: #7f8c8d;
    text-align: center;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        height: auto;
    }

    header {
        position: sticky;
    }

    .content {
        padding: 12px;
    }
}
