
/* =========================================================
   WORKTRACKER
   PROFESSIONAL RESPONSIVE STYLE
   ========================================================= */

/* =========================================================
   GLOBAL
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: #f5f7fb;
    color: #111827;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
}


/* =========================================================
   APPLICATION LAYOUT
   ========================================================= */

.app-layout {
    min-height: 100vh;
    display: flex;
}

.main-wrapper {
    width: calc(100% - 250px);
    min-width: 0;
    min-height: 100vh;
    margin-left: 250px;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: 250px;
    min-width: 250px;
    min-height: 100vh;

    background: #111827;
    color: #ffffff;

    z-index: 1000;

    overflow-x: hidden;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: #374151 #111827;

    transition: transform 0.2s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #111827;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 10px;
}


/* Sidebar Brand */

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-name {
    color: #ffffff;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.brand-subtitle {
    margin-top: 5px;
    color: #9ca3af;
    font-size: 12px;
}


/* Sidebar Menu */

.sidebar-menu {
    padding: 16px 12px;
}

.menu-section {
    margin: 18px 10px 8px;

    color: #6b7280;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-menu a {
    display: flex;
    align-items: center;

    min-height: 42px;

    margin-bottom: 3px;
    padding: 9px 12px;

    border-radius: 7px;

    color: #d1d5db;

    font-size: 14px;
    font-weight: 500;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.sidebar-menu a.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
}


/* =========================================================
   TOP HEADER
   ========================================================= */

.top-header {
    position: sticky;
    top: 0;

    z-index: 900;

    width: 100%;
    min-height: 68px;

    padding: 0 28px;

    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.top-header-title {
    min-width: 0;
    flex: 1;
}

.page-title {
    margin: 0;

    color: #111827;

    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* User Area */

.user-area {
    display: flex;
    align-items: center;

    gap: 18px;

    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;

    gap: 10px;
}

.user-name {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    display: inline-flex;
    align-items: center;

    min-height: 22px;

    padding: 4px 8px;

    border-radius: 12px;

    background: #eff6ff;
    color: #2563eb;

    font-size: 10px;
    font-weight: 700;
}

.logout-link {
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
}

.logout-link:hover {
    text-decoration: underline;
}


/* =========================================================
   MOBILE MENU
   ========================================================= */

.mobile-menu-button {
    display: none;

    width: 40px;
    height: 40px;

    padding: 0;

    border: 1px solid #e5e7eb;
    border-radius: 7px;

    background: #ffffff;
    color: #374151;

    font-size: 20px;
    line-height: 1;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

.mobile-menu-button:hover {
    background: #f3f4f6;
}

.mobile-sidebar-overlay {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 999;

    background: rgba(0, 0, 0, 0.45);
}

.mobile-sidebar-overlay.active {
    display: block;
}


/* =========================================================
   PAGE CONTENT
   ========================================================= */

.page-content {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;
    padding: 28px;
}


/* =========================================================
   PAGE TOOLBAR
   ========================================================= */

.page-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.page-toolbar h1 {
    margin: 0;

    color: #111827;

    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
}

.page-subtitle {
    margin: 6px 0 0;

    color: #6b7280;

    font-size: 14px;
}


/* =========================================================
   COMMON CARD
   ========================================================= */

.dashboard-card,
.form-card {
    width: 100%;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dashboard-card {
    margin-bottom: 25px;
    padding: 25px;
}

.dashboard-card h2 {
    margin-top: 0;
    color: #1f2937;
}

.dashboard-card p {
    color: #6b7280;
}


/* =========================================================
   SECTION HEADER
   ========================================================= */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 18px;
}

.section-header h3 {
    margin: 0;

    color: #1f2937;

    font-size: 18px;
    font-weight: 700;
}

.section-subtitle {
    margin: 5px 0 0;

    color: #6b7280;
    font-size: 13px;
}

.section-count {
    min-width: 30px;
    height: 30px;

    padding: 0 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 20px;

    background: #f1f5f9;
    color: #475569;

    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: #f5f7fb;
}

.login-card {
    width: 100%;
    max-width: 400px;

    padding: 35px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.login-title {
    margin: 0 0 8px;

    color: #111827;

    text-align: center;

    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
}

.login-subtitle {
    margin: 0 0 30px;

    color: #777777;

    text-align: center;

    font-size: 14px;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-card {
    padding: 25px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;

    margin-bottom: 18px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #374151;

    font-size: 14px;
    font-weight: 600;
}


/* Inputs */

.form-group input,
.form-group textarea,
.form-group select,
.form-control {
    width: 100%;

    padding: 10px 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: #ffffff;
    color: #111827;

    font-size: 14px;
    font-family: inherit;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input,
.form-control {
    min-height: 40px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-control {
    height: 44px;
    border-radius: 7px;
    font-size: 15px;
}


/* Focus */

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-control:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* Help */

.form-help {
    display: block;

    margin-top: 5px;

    color: #6b7280;

    font-size: 12px;
}


/* =========================================================
   FORM ACTIONS
   ========================================================= */

.form-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid #e5e7eb;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn-primary,
.btn-secondary,
.btn-small,
.btn-warning,
.btn-success,
.btn-danger-small,
.btn-success-small {
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.1s ease;
}

.btn-primary {
    display: inline-block;

    padding: 9px 16px;

    border: none;
    border-radius: 5px;

    background: #2563eb;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    display: inline-block;

    padding: 9px 15px;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    background: #ffffff;
    color: #374151;

    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #f3f4f6;
}

.btn-small {
    display: inline-block;

    padding: 6px 12px;

    border: none;
    border-radius: 5px;

    background: #2563eb;
    color: #ffffff;

    font-size: 13px;
}

.btn-small:hover {
    background: #1d4ed8;
}

.btn-login {
    width: 100%;
    height: 44px;

    border: none;
    border-radius: 7px;

    background: #2563eb;
    color: #ffffff;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}

.btn-login:hover {
    background: #1d4ed8;
}

.btn-warning {
    display: inline-block;

    padding: 9px 16px;

    border: none;
    border-radius: 5px;

    background: #f59e0b;
    color: #ffffff;

    font-weight: 600;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-success {
    display: inline-block;

    padding: 9px 16px;

    border: none;
    border-radius: 5px;

    background: #16a34a;
    color: #ffffff;

    font-weight: 600;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger-small {
    display: inline-block;

    padding: 6px 12px;

    border: none;
    border-radius: 5px;

    background: #dc2626;
    color: #ffffff;

    font-size: 13px;
    font-weight: 600;
}

.btn-danger-small:hover {
    background: #b91c1c;
}

.btn-success-small {
    display: inline-block;

    padding: 6px 12px;

    border: none;
    border-radius: 5px;

    background: #16a34a;
    color: #ffffff;

    font-size: 13px;
    font-weight: 600;
}

.btn-success-small:hover {
    background: #15803d;
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert-error,
.alert-success {
    padding: 12px 15px;

    margin-bottom: 20px;

    border-radius: 6px;

    font-size: 14px;
}

.alert-error {
    border: 1px solid #fecaca;

    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    border: 1px solid #bbf7d0;

    background: #dcfce7;
    color: #166534;
}

.alert-error ul {
    margin: 0;
    padding-left: 20px;
}

.alert-error li {
    margin-bottom: 4px;
}

.alert-error li:last-child {
    margin-bottom: 0;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-responsive {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;

    border-collapse: collapse;

    background: #ffffff;
}

.data-table th,
.data-table td {
    padding: 12px 14px;

    border-bottom: 1px solid #e5e7eb;

    text-align: left;
    vertical-align: middle;

    white-space: nowrap;

    font-size: 14px;
}

.data-table th {
    background: #f8fafc;

    color: #374151;

    font-weight: 600;
}

.data-table tbody tr {
    transition: background 0.12s ease;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================================
   STATUS / PRIORITY BADGES
   ========================================================= */

.status-badge,
.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;

    white-space: nowrap;
}

.status-assigned {
    background: #e0e7ff;
    color: #3730a3;
}

.status-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-hold {
    background: #fef3c7;
    color: #92400e;
}

.status-finished {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.priority-low {
    background: #f3f4f6;
    color: #374151;
}

.priority-medium {
    background: #dbeafe;
    color: #1d4ed8;
}

.priority-high {
    background: #fed7aa;
    color: #9a3412;
}

.priority-critical {
    background: #fee2e2;
    color: #991b1b;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    width: 100%;

    padding: 40px 20px;

    text-align: center;

    background: #f8fafc;

    border: 1px dashed #cbd5e1;
    border-radius: 8px;

    color: #64748b;
}


/* =========================================================
   FILTER FORM
   ========================================================= */

.filter-form {
    margin-top: 20px;

    padding: 18px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.filter-row {
    display: flex;
    align-items: flex-end;

    gap: 15px;

    flex-wrap: wrap;
}

.filter-row .form-group {
    min-width: 170px;

    margin-bottom: 0;
}

.filter-row .form-group label {
    display: block;

    margin-bottom: 6px;

    color: #374151;

    font-size: 13px;
    font-weight: 600;
}

.filter-row input,
.filter-row select {
    width: 100%;
    min-height: 40px;

    padding: 8px 10px;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    background: #ffffff;
    color: #111827;

    box-sizing: border-box;
}

.filter-row input:focus,
.filter-row select:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

.filter-buttons {
    display: flex;
    align-items: center;

    gap: 8px;

    padding-bottom: 0;
}

.result-summary {
    margin: 18px 0;

    color: #6b7280;

    font-size: 14px;
}


/* =========================================================
   TASK DETAILS
   ========================================================= */

.task-details-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 20px;

    margin-top: 20px;
}

.detail-item {
    min-width: 0;

    padding: 15px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.detail-label {
    display: block;

    margin-bottom: 6px;

    color: #6b7280;

    font-size: 12px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.task-description {
    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid #e5e7eb;
}

.task-description h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.text-muted {
    color: #6b7280;
}


/* =========================================================
   TASK ACTIONS
   ========================================================= */

.task-action-card {
    margin-top: 25px;

    padding: 20px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.task-action-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.action-buttons {
    display: flex;

    gap: 20px;

    flex-wrap: wrap;
}

.action-buttons form {
    flex: 1;

    min-width: 280px;
}

.inline-action {
    display: flex;
    align-items: center;

    gap: 10px;
}

.inline-action input {
    flex: 1;

    min-height: 40px;

    padding: 8px 10px;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    background: #ffffff;
}

.inline-action input:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

.transfer-action {
    margin-top: 22px;
    padding-top: 18px;

    border-top: 1px solid #e5e7eb;
}

.transfer-action .btn-warning {
    display: inline-block;

    text-decoration: none;
}

.task-closed-message {
    margin-top: 25px;

    padding: 15px;

    border-radius: 8px;

    background: #f1f5f9;
    color: #475569;
}


/* =========================================================
   TASK VIEW
   ========================================================= */

.task-view-page {
    width: 100%;
    min-width: 0;
}

.task-view-page .history-section {
    width: 100%;

    margin-top: 35px;
    padding-top: 25px;

    border-top: 1px solid #e5e7eb;
}

.history-section {
    margin-top: 30px;
    padding-top: 20px;

    border-top: 1px solid #e5e7eb;
}

.history-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.work-log-section {
    margin-top: 40px;
}

.status-history-section {
    margin-top: 40px;
}


/* =========================================================
   TASK HISTORY TABLE
   ========================================================= */

.task-history-table {
    width: 100%;

    min-width: 850px;
}

.task-history-table th,
.task-history-table td {
    vertical-align: top;
}


/* =========================================================
   WORK DESCRIPTION
   ========================================================= */

.work-description {
    min-width: 300px;
    max-width: 500px;

    white-space: normal !important;

    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* =========================================================
   COMMENTS
   ========================================================= */

.comments-section {
    width: 100%;

    margin-top: 40px;
}

.comment-form-card {
    margin-bottom: 25px;

    padding: 20px;

    background: #f8fafc;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.comment-form-card .form-group {
    margin-bottom: 15px;
}

.comment-form-card label {
    display: block;

    margin-bottom: 7px;

    color: #374151;

    font-size: 14px;
    font-weight: 600;
}

.comment-form-card textarea {
    width: 100%;

    min-height: 100px;

    padding: 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: #ffffff;

    resize: vertical;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.comment-form-card textarea:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.character-hint {
    color: #6b7280;
    font-size: 12px;
}

.comments-list {
    display: flex;
    flex-direction: column;

    gap: 15px;
}

.comment-item {
    padding: 18px 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 12px;
}

.comment-user {
    color: #1f2937;
}

.comment-role {
    display: inline-block;

    margin-left: 8px;
    padding: 3px 8px;

    border-radius: 12px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 11px;
    font-weight: 600;
}

.comment-date {
    color: #6b7280;

    font-size: 12px;

    white-space: nowrap;
}

.comment-body {
    padding-top: 12px;

    border-top: 1px solid #f1f5f9;

    color: #374151;

    line-height: 1.6;

    white-space: normal;
    overflow-wrap: anywhere;
}

.comment-empty {
    margin-top: 10px;
}


/* =========================================================
   COMPLETE TASK HISTORY
   ========================================================= */

.complete-history-section {
    margin-top: 40px;
}

.complete-history {
    position: relative;

    width: 100%;

    padding: 5px 0;
}


/* Timeline */

.complete-history::before {
    content: "";

    position: absolute;

    top: 15px;
    bottom: 15px;

    left: 15px;

    width: 2px;

    background: #e5e7eb;
}

.history-timeline-item {
    position: relative;

    display: flex;

    gap: 20px;

    margin-bottom: 25px;
}

.history-timeline-item:last-child {
    margin-bottom: 0;
}


/* Marker */

.history-timeline-marker {
    position: relative;

    z-index: 2;

    flex: 0 0 32px;

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
}

.history-timeline-marker span {
    display: block;

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: #64748b;

    border: 3px solid #ffffff;

    box-shadow:
        0 0 0 2px #cbd5e1;
}


/* Timeline Content */

.history-timeline-content {
    flex: 1;

    min-width: 0;

    padding: 17px 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.history-event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 12px;
}

.history-event-title {
    display: inline-block;

    color: #1f2937;

    font-size: 15px;
}

.history-event-type {
    display: inline-block;

    margin-left: 8px;

    padding: 3px 8px;

    border-radius: 12px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 10px;
    font-weight: 600;

    vertical-align: middle;
}

.history-event-date {
    color: #6b7280;

    font-size: 12px;

    white-space: nowrap;
}

.history-event-description {
    padding-top: 12px;

    border-top: 1px solid #f1f5f9;

    color: #374151;

    line-height: 1.6;

    white-space: normal;

    overflow-wrap: anywhere;
}

.history-event-user {
    margin-top: 12px;

    color: #6b7280;

    font-size: 12px;
}


/* Event Types
   NOTE:
   These selectors intentionally use the full class combination.
*/

.history-event-task-created .history-timeline-marker span {
    background: #2563eb;
}

.history-event-assignment .history-timeline-marker span {
    background: #7c3aed;
}

.history-event-work-log .history-timeline-marker span {
    background: #0891b2;
}

.history-event-status-change .history-timeline-marker span {
    background: #f59e0b;
}

.history-event-comment .history-timeline-marker span {
    background: #16a34a;
}


/* =========================================================
   EMPLOYEE SUMMARY
   ========================================================= */

.employee-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 15px;

    margin: 20px 0;
}

.summary-card {
    padding: 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    text-align: center;
}

.summary-number {
    margin-bottom: 5px;

    color: #2563eb;

    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

.summary-label {
    color: #6b7280;

    font-size: 13px;
    font-weight: 600;
}

.task-list-description {
    max-width: 250px;

    margin-top: 5px;

    color: #6b7280;

    font-size: 12px;

    white-space: normal;
    overflow-wrap: anywhere;
}


/* =========================================================
   EMPLOYEE TASK SUMMARY
   ========================================================= */

.employee-task-summary-card {
    margin-top: 30px;
}

.summary-date-form {
    display: flex;
    align-items: center;

    gap: 8px;
}

.summary-date-form label {
    color: #374151;

    font-size: 13px;
    font-weight: 600;
}

.summary-date-form input {
    min-height: 38px;

    padding: 7px 10px;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    background: #ffffff;
    color: #374151;
}

.summary-date-form input:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}

.employee-task-summary-table th,
.employee-task-summary-table td {
    text-align: center;
    vertical-align: middle;
}

.employee-task-summary-table th:first-child,
.employee-task-summary-table td:first-child {
    text-align: left;
}

.task-count-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 30px;
    min-height: 30px;

    padding: 3px 8px;

    border-radius: 5px;

    color: #2563eb;

    font-weight: 700;

    transition: background 0.15s ease;
}

.task-count-link:hover {
    background: #dbeafe;

    text-decoration: underline;
}

.task-count-finished {
    color: #16a34a;
}

.task-count-finished:hover {
    background: #dcfce7;
}

.task-count-zero {
    color: #9ca3af;
    font-weight: 600;
}

.task-count-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 28px;
    min-height: 28px;

    padding: 3px 8px;

    border-radius: 5px;

    background: #dbeafe;
    color: #1d4ed8;

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   ADMIN DASHBOARD
   ========================================================= */

.admin-dashboard {
    width: 100%;
}

.dashboard-card .section-header {
    margin-bottom: 18px;
}

.dashboard-card .action-buttons {
    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

.dashboard-card .action-buttons a {
    text-decoration: none;
}


/* =========================================================
   CLIENT
   ========================================================= */

.client-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    flex-wrap: wrap;
}

.inline-form {
    display: inline;

    margin: 0;
}

.gstin-text {
    font-family: monospace;

    font-size: 13px;

    letter-spacing: 0.3px;
}


/* =========================================================
   WORK LOGS
   ========================================================= */

.work-log-table th,
.work-log-table td {
    vertical-align: top;
}

.work-log-table .task-link {
    color: #2563eb;

    font-weight: 600;

    text-decoration: none;
}

.work-log-table .task-link:hover {
    text-decoration: underline;
}

.task-small-title {
    max-width: 220px;

    margin-top: 4px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #6b7280;

    font-size: 12px;
}

.entry-type-badge,
.transfer-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 5px;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}

.entry-type-badge {
    background: #f3f4f6;
    color: #374151;
}

.transfer-badge {
    background: #ede9fe;
    color: #6d28d9;
}

.work-log-table .work-description {
    min-width: 300px;
    max-width: 500px;

    white-space: normal !important;

    line-height: 1.5;
}

.work-log-table td:nth-child(2),
.work-log-table td:nth-child(7),
.work-log-table td:nth-child(8),
.work-log-table td:nth-child(9) {
    white-space: nowrap;
}

.assignment-row {
    background: #faf5ff;
}

.assignment-row:hover {
    background: #f5f3ff !important;
}

.assignment-reason {
    margin-top: 8px;

    padding: 7px 10px;

    border-left: 3px solid #8b5cf6;

    background: #f5f3ff;
    color: #5b21b6;

    font-size: 12px;

    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* =========================================================
   DAILY REPORT
   ========================================================= */

.daily-report {
    width: 100%;
}

.report-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 25px;
}

.report-summary-card {
    padding: 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.report-summary-card .summary-number {
    margin-bottom: 5px;
}

.report-summary-card .summary-label {
    color: #6b7280;
}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    body {
        background: #ffffff;
    }

    .sidebar,
    .top-header,
    .mobile-menu-button,
    .mobile-sidebar-overlay,
    .filter-form,
    .page-toolbar .btn-primary,
    .page-toolbar .btn-secondary {
        display: none !important;
    }

    .main-wrapper {
        width: 100%;
        margin-left: 0;
    }

    .page-content {
        max-width: none;
        padding: 0;
    }

    .dashboard-card,
    .form-card {
        border: none;
        box-shadow: none;
    }

    .table-responsive {
        overflow: visible;
    }

    .data-table {
        width: 100%;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .main-wrapper {
        width: calc(100% - 220px);
        margin-left: 220px;
    }

    .page-content {
        padding: 22px;
    }

    .top-header {
        padding: 0 22px;
    }

    .employee-summary-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .report-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 900px) {

    .task-details-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .filter-row {
        align-items: stretch;
    }

    .filter-row .form-group {
        min-width: 200px;
        flex: 1;
    }

    .filter-buttons {
        width: 100%;
    }

    .employee-summary-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    /* Sidebar */

    .sidebar {
        width: 270px;
        min-width: 270px;

        transform: translateX(-100%);

        box-shadow:
            8px 0 25px rgba(0, 0, 0, 0.15);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }


    /* Main */

    .main-wrapper {
        width: 100%;
        margin-left: 0;
    }


    /* Header */

    .top-header {
        min-height: 60px;

        padding: 0 14px;

        gap: 10px;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .top-header .page-title {
        font-size: 16px;
    }

    .user-area {
        gap: 8px;
    }

    .user-info {
        display: none;
    }

    .logout-link {
        font-size: 12px;
    }


    /* Content */

    .page-content {
        padding: 16px;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;

        gap: 14px;

        margin-bottom: 18px;
    }

    .page-toolbar h1 {
        font-size: 21px;
    }

    .page-subtitle {
        font-size: 13px;
    }


    /* Cards */

    .dashboard-card {
        padding: 18px;
    }

    .form-card {
        padding: 18px;
    }


    /* Forms */

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group-full {
        grid-column: auto;
    }

    .form-actions {
        flex-wrap: wrap;
    }


    /* Task */

    .task-details-grid {
        grid-template-columns: 1fr;
    }


    /* Summary */

    .employee-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .report-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    /* Section */

    .section-header {
        align-items: flex-start;
    }

    .employee-task-summary-card .section-header {
        flex-direction: column;
    }

    .summary-date-form {
        width: 100%;

        align-items: flex-start;

        flex-direction: column;
    }

    .summary-date-form input {
        width: 100%;
    }


    /* Tables */

    .table-responsive {
        overflow-x: auto;

        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 700px;
    }


    /* Filters */

    .filter-row {
        display: block;
    }

    .filter-row .form-group {
        width: 100%;

        margin-bottom: 12px;
    }

    .filter-buttons {
        margin-top: 10px;
    }


    /* Actions */

    .action-buttons {
        display: block;
    }

    .action-buttons form {
        width: 100%;

        min-width: 0;

        margin-bottom: 15px;
    }

    .inline-action {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-action input,
    .inline-action button {
        width: 100%;
    }

    .transfer-action .btn-warning {
        width: 100%;

        text-align: center;
    }


    /* Comments */

    .comment-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .comment-date {
        white-space: normal;
    }

    .comment-form-footer {
        align-items: stretch;

        flex-direction: column;
    }

    .comment-form-footer .btn-primary {
        width: 100%;
    }


    /* Timeline */

    .complete-history::before {
        left: 11px;
    }

    .history-timeline-item {
        gap: 14px;
    }

    .history-timeline-marker {
        flex: 0 0 24px;

        width: 24px;
        height: 24px;
    }

    .history-timeline-marker span {
        width: 9px;
        height: 9px;

        border-width: 2px;
    }

    .history-timeline-content {
        padding: 14px;
    }

    .history-event-header {
        flex-direction: column;

        gap: 8px;
    }

    .history-event-date {
        white-space: normal;
    }

    .history-event-type {
        margin-left: 4px;
    }


    /* Dashboard Actions */

    .dashboard-card .action-buttons {
        display: block;
    }

    .dashboard-card .action-buttons a {
        display: block;

        width: 100%;

        margin-bottom: 10px;

        text-align: center;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .page-content {
        padding: 12px;
    }

    .page-toolbar h1 {
        font-size: 19px;
    }

    .dashboard-card {
        padding: 15px;
    }

    .form-card {
        padding: 15px;
    }


    /* Summary */

    .employee-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 17px;
    }

    .summary-number {
        font-size: 25px;
    }


    /* Tables */

    .data-table {
        min-width: 650px;
    }

    .task-history-table {
        min-width: 800px;
    }


    /* Task view */

    .task-view-page .history-section {
        margin-top: 25px;
        padding-top: 20px;
    }


    /* Comments */

    .comment-item {
        padding: 15px;
    }


    /* Buttons */

    .form-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary,
    .form-actions .btn-warning,
    .form-actions .btn-success {
        width: 100%;

        text-align: center;
    }


    /* Client Actions */

    .client-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .client-actions a,
    .client-actions button {
        width: 100%;

        text-align: center;
    }
}


/* =========================================================
   EXTRA SMALL MOBILE
   ========================================================= */

@media (max-width: 400px) {

    .page-content {
        padding: 10px;
    }

    .top-header {
        padding: 0 10px;
    }

    .mobile-menu-button {
        width: 38px;
        height: 38px;
    }

    .top-header .page-title {
        font-size: 15px;
    }

    .logout-link {
        font-size: 11px;
    }

    .page-toolbar h1 {
        font-size: 18px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .dashboard-card,
    .form-card {
        border-radius: 8px;
    }

    .summary-card {
        padding: 15px;
    }

    .summary-number {
        font-size: 23px;
    }

    .login-card {
        padding: 25px 18px;
    }

    .login-title {
        font-size: 24px;
    }
}

