/* =========================================================
   MY6996 HR SYSTEM V2 - CLEAN APP.CSS
========================================================= */

:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #182033;
    --muted: #7b8499;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #e8f0ff;

    --purple: #6d28d9;
    --purple-soft: #f2ebff;

    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --success: #16a34a;
    --success-soft: #dcfce7;

    --warning: #f59e0b;
    --warning-soft: #fef3c7;

    --info: #1d4ed8;
    --info-soft: #dbeafe;

    --border: #e5e9f2;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* RESET */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

body.modal-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* LAYOUT */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 22px;
}

/* SIDEBAR */

.mobile-topbar,
.sidebar-backdrop {
    display: none;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    color: #111827;
    padding: 18px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.04);
    z-index: 1000;
}

.sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.sidebar-brand {
    text-decoration: none;
    display: block;
}

.sidebar-brand-logo-only {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sidebar-logo-full {
    width: 180px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.sidebar-close-btn {
    display: none;
}

.sidebar-user {
    background: #f7f8fc;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 22px;
}

.user-name {
    color: #111827;
    font-weight: 800;
    font-size: 14px;
}

.user-role {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.sidebar-menu {
    padding-bottom: 20px;
}

.menu-section {
    color: #2f3470;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    margin: 22px 8px 10px;
    letter-spacing: 0.04em;
}

.menu-item {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #5f6b7a;
    background: transparent;
    border: 0;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: 0.15s ease;
}

.menu-item:hover {
    background: #f4f5fb;
    color: #111827;
}

.menu-item.active {
    background: var(--purple-soft);
    color: var(--purple);
}

.menu-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.menu-icon {
    width: 22px;
    height: 22px;
    border: 1px solid #dbe2ea;
    color: #7b8794;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex: 0 0 auto;
}

.menu-item.active .menu-icon {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: var(--purple);
}

.menu-item.logout {
    color: var(--danger);
}

.menu-item.logout:hover {
    background: var(--danger-soft);
    color: #991b1b;
}

.menu-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 7px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* CARD / SECTION */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.section-head h2 {
    margin: 0;
    font-size: 18px;
}

.section-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

/* GRID */

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* BUTTON */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    min-height: 34px;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn-light {
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-light:hover {
    background: #dbeafe;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 7px 11px;
    font-size: 12px;
    min-height: 32px;
}

/* FORM */

.form-box {
    max-width: 420px;
    margin: 8vh auto;
    background: #fff;
    padding: 26px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-box h1 {
    margin: 0 0 6px;
}

.form-box p {
    margin: 0 0 22px;
    color: var(--muted);
}

.form-box .form-group {
    margin-bottom: 14px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
    font-size: 13px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.input {
    width: 100%;
    height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: #fff;
    color: var(--text);
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .input {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #7b8499;
    font-size: 14px;
    padding: 0;
}

/* ALERT */

.alert {
    padding: 11px 13px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 600;
}

.alert-danger {
    background: var(--danger-soft);
    color: #991b1b;
}

.alert-success {
    background: var(--success-soft);
    color: #166534;
}

.alert-warning {
    background: var(--warning-soft);
    color: #92400e;
}

/* TABLE */

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
}

.table th,
.table td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td small {
    color: var(--muted);
}

.table tr:hover td {
    background: #fafbff;
}

/* BADGE */

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-soft);
    color: #166534;
}

.badge-danger {
    background: var(--danger-soft);
    color: #991b1b;
}

.badge-info {
    background: var(--info-soft);
    color: var(--info);
}

.badge-warning {
    background: var(--warning-soft);
    color: #92400e;
}

/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 18px;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #fff;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
    border: 1px solid #d9dfe8;
    padding: 0;
}

.modal-large {
    max-width: 860px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.modal-header p {
    display: none;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #6b7280;
    border-radius: 6px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

/* COMPACT FORM */

.modal-form {
    padding: 18px 28px 16px;
}

.compact-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.compact-form .form-group {
    display: grid;
    grid-template-columns: 135px 1fr;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.compact-form .form-group label {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    text-align: right;
}

.compact-form .form-group small {
    grid-column: 2;
    margin-top: -2px;
    font-size: 11px;
    color: #7b8499;
}

.compact-form .input {
    height: 32px;
    padding: 6px 10px;
    border-radius: 6px;
}

/* USER MANAGEMENT */

.user-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.user-filter-row .input {
    max-width: 240px;
}

.user-action {
    white-space: nowrap;
}

/* DASHBOARD */

.stat-card,
.dashboard-stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 8px;
}

.dashboard-hero h2 {
    margin: 0;
    font-size: 20px;
}

.dashboard-hero p {
    margin: 8px 0 0;
    color: var(--muted);
}

.dashboard-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.dashboard-stat-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    min-height: 94px;
}

.stat-desc {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-work-time {
    font-size: 20px;
}

.dash-arrow-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.dashboard-card-head h2,
.dashboard-card-title {
    margin: 0;
    font-size: 18px;
}

.dashboard-card-head p {
    margin: 5px 0 0;
    color: var(--muted);
}

.dashboard-punch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-punch-grid form {
    margin: 0;
}

.dashboard-punch-btn {
    width: 100%;
    min-height: 82px;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    border-radius: 12px;
    cursor: pointer;
    padding: 12px;
    text-align: center;
}

.dashboard-punch-btn span {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

.dashboard-punch-btn strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
}

.dashboard-punch-btn small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.dashboard-punch-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dashboard-duty-list,
.dashboard-duty-box {
    margin-top: 12px;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-duty-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--info-soft);
    color: var(--info);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
}

.dashboard-duty-row {
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: #fff;
    padding: 8px 12px;
    display: inline-flex;
    flex-direction: column;
    min-width: 120px;
}

.dashboard-duty-name {
    font-size: 13px;
    font-weight: 800;
    color: #111827;
}

.dashboard-duty-remark {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.dashboard-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.dashboard-list-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-list-item strong {
    display: block;
    font-size: 13px;
}

.dashboard-list-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-notice-card {
    margin-top: 20px;
}

.dashboard-working-modal {
    max-width: 720px;
}

.dashboard-modal-body {
    padding: 16px;
    max-height: 520px;
    overflow-y: auto;
}

.dashboard-working-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}

/* ATTENDANCE */

.module-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.module-tab {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.module-tab:hover,
.module-tab.active {
    color: var(--primary);
}

.module-tab.active {
    border-bottom-color: var(--primary);
}

.attendance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
}

.attendance-main,
.attendance-side {
    min-width: 0;
}

.attendance-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.attendance-card-head h2 {
    margin: 0;
    font-size: 18px;
}

.attendance-card-head p {
    margin: 5px 0 0;
    color: var(--muted);
}

.attendance-status-pill,
.day-detail-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 800;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.attendance-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.attendance-summary-row div {
    padding: 12px 14px;
    background: #f8fafc;
    border-right: 1px solid var(--border);
}

.attendance-summary-row div:last-child {
    border-right: 0;
}

.attendance-summary-row span,
.day-detail-list span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.attendance-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.attendance-actions form {
    margin: 0;
}

.attendance-action-btn {
    width: 100%;
    min-height: 72px;
    border: 1px solid #dbe3ef;
    background: #ffffff;
    border-radius: 10px;
    cursor: pointer;
    padding: 12px;
    text-align: left;
}

.attendance-action-btn span {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 6px;
}

.attendance-action-btn small {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

.attendance-action-btn:disabled {
    background: #f8fafc;
    cursor: not-allowed;
    opacity: 0.68;
}

.attendance-calendar-card {
    margin-top: 20px;
}

.calendar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.attendance-calendar-wrap {
    width: 100%;
    overflow-x: auto;
}

.attendance-calendar {
    min-width: 760px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.calendar-weekday {
    background: #f8fafc;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
}

.calendar-day,
.attendance-calendar button.calendar-day {
    width: 100%;
    min-height: 92px;
    padding: 9px;
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    display: block;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.calendar-day:hover,
.attendance-calendar button.calendar-day:hover {
    background: #f8fbff;
}

.calendar-day.empty,
.attendance-calendar button.calendar-day.empty {
    background: #f9fafb;
    pointer-events: none;
}

.calendar-day.today,
.attendance-calendar button.calendar-day.today {
    background: #fff7ed;
}

.calendar-day.selected,
.attendance-calendar button.calendar-day.selected {
    background: #eff6ff;
    box-shadow: inset 0 0 0 2px var(--primary);
}

.calendar-date {
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 6px;
}

.calendar-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 5px;
}

.calendar-time {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.day-detail-list {
    border-top: 1px solid var(--border);
}

.day-detail-list div {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.day-detail-list strong {
    display: block;
    font-size: 13px;
    word-break: break-word;
}

.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.break-cell {
    min-width: 88px;
}

.break-label {
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
}

.break-time {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.employee-select {
    min-width: 360px;
}

.modal-attendance-edit {
    max-width: 680px;
}

.att-edit-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.att-edit-row > label {
    text-align: right;
    font-weight: 700;
}

.att-edit-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-left: 132px;
    margin-bottom: 10px;
}

.att-edit-section-title {
    margin: 14px 0 8px 132px;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
}

/* LEAVE / SCHEDULE */

.leave-calendar-layout,
.schedule-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    margin-top: 16px;
}

.leave-day-list {
    display: grid;
    gap: 12px;
}

.leave-day-item,
.leave-day-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.leave-day-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.leave-day-user strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.leave-day-meta,
.leave-day-reason {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.leave-day-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.leave-day-info span,
.schedule-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.leave-dot {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 6px;
    font-size: 10px;
    font-weight: 800;
}

.leave-dot-mc {
    background: #fee2e2;
    color: #991b1b;
}

.leave-dot-al {
    background: #dbeafe;
    color: #1d4ed8;
}

.leave-dot-el {
    background: #fef3c7;
    color: #92400e;
}

.leave-dot-ul {
    background: #e5e7eb;
    color: #374151;
}

.leave-dot-other {
    background: #ede9fe;
    color: #5b21b6;
}

.schedule-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.schedule-weekday,
.schedule-day {
    padding: 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.schedule-weekday {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
    color: #667085;
}

.schedule-day {
    min-height: 90px;
    background: #fff;
    color: #0f172a;
}

.schedule-day.empty {
    background: #f8fafc;
}

.schedule-day.selected {
    background: #fff7ed;
    outline: 2px solid #ff6b00;
    outline-offset: -2px;
}

.schedule-day-number {
    font-weight: 800;
    margin-bottom: 6px;
}

.schedule-sidebar {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    background: #fff;
}

.schedule-sidebar-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
}

.schedule-working {
    background: #ecfdf5;
}

.schedule-off {
    background: #f1f5f9;
}

.schedule-leave {
    background: #fef3c7;
}

.schedule-change-off {
    background: #dbeafe;
}

/* DUTY */

.duty-agent-badge,
.dashboard-duty-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--info-soft);
    color: var(--info);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
}

.duty-group-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.duty-staff-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.duty-staff-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.duty-staff-name,
.duty-agent-name {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.duty-agent-box {
    margin: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.duty-agent-row {
    display: inline-flex;
    flex-direction: column;
    min-width: 120px;
}

.duty-agent-remark {
    margin-top: 3px;
    font-size: 13px;
    color: var(--muted);
}

/* NOTICE */

.notice-card-list {
    display: grid;
    gap: 10px;
}

.notice-card-item {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.notice-card-item:hover {
    background: #f8fbff;
}

.notice-card-item strong {
    display: block;
    font-size: 14px;
}

.notice-card-item small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.notice-modal-body {
    padding: 16px;
}

.notice-modal-image,
.notice-popup-image,
.notice-toast-image {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 14px;
    background: #f8fafc;
}

.notice-modal-content {
    line-height: 1.6;
    color: #334155;
}

.notice-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.notice-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 420px;
    max-width: calc(100vw - 28px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    padding: 18px;
    z-index: 99999;
}

.notice-toast-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.notice-toast-head h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.notice-toast-close {
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: var(--muted);
}

.notice-toast h3 {
    margin: 14px 0 8px;
    font-size: 15px;
}

.notice-toast-meta,
.notice-toast-content {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.notice-toast-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

/* LOGIN PAGE */

.login-body {
    min-height: 100vh;
    background:
        linear-gradient(rgba(248,250,255,.90), rgba(248,250,255,.90)),
        url("../images/background.png") center center / cover no-repeat;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-wrapper{
    position:relative;
    width:1180px;
    min-height:520px;
    border-radius:36px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:70px 70px;
    background:linear-gradient(135deg,#162968 0%,#2948b8 100%);
    box-shadow:0 30px 80px rgba(0,0,0,.18);
}

.login-bg {
    position: absolute;
    inset: 0;
    border-radius: 34px;
    background: linear-gradient(135deg,#13214d,#2346a0);
    box-shadow: 0 30px 80px rgba(15,23,42,.25);
}

.login-left{
    position:relative;
    z-index:2;
    width:58%;
    min-height:420px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.login-logo-wide {
    width: 220px;
    display: block;
}

.login-globe{
    position:absolute;
    right:-120px;
    bottom:-140px;
    width:520px;
    height:520px;
    opacity:.22;
    pointer-events:none;
}

.login-globe img{
    width:100%;
    height:100%;
    object-fit:contain;
}

.login-brand-text {
    position: absolute;
    left: 0;
    bottom: 0;
}

.login-brand-text h1 {
    margin: 0 0 10px;
    font-size: 42px;
    color: #fff;
}

.login-brand-text p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 15px;
}

.login-card{
    position:relative;
    z-index:2;
    width:420px;
    background:#fff;
    border-radius:30px;
    padding:38px;
    margin-right:40px;
    box-shadow:0 20px 60px rgba(0,0,0,.18);
}

.login-card h2,
.login-card-head h2 {
    margin: 0;
    font-size: 28px;
}

.login-card p,
.login-card-head p {
    margin: 8px 0 22px;
    color: var(--muted);
}

.login-card .input {
    height: 46px;
    border-radius: 12px;
}

.login-btn {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    margin-top: 18px;
}

/* UTILITY */

.text-muted {
    color: var(--muted);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.manual-time-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.manual-time-row .btn {
    white-space: nowrap;
}

/* MOBILE */

@media (max-width: 1100px) {
    .dashboard-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid-2,
    .attendance-layout,
    .leave-calendar-layout,
    .schedule-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    body:not(.login-body) {
        padding-top: 74px;
    }

    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 74px;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
        z-index: 10020;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 18px;
    }

    .mobile-topbar-logo img {
        height: 46px;
        width: auto;
        display: block;
    }

    .mobile-menu-btn {
        width: 42px;
        height: 42px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #fff;
        color: var(--primary);
        font-size: 24px;
        font-weight: 800;
        cursor: pointer;
    }

    .app-shell {
        display: block;
        min-height: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 292px;
        max-width: 82vw;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        z-index: 10040;
        border-radius: 0;
        padding: 18px 16px;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(3px);
        z-index: 10030;
        display: none;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #f8fafc;
        font-size: 24px;
        color: #64748b;
        cursor: pointer;
    }

    .sidebar-logo-full {
        max-width: 165px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 16px;
    }

    .login-shell {
        padding: 20px;
    }

    .login-wrapper {
        width: 100%;
        min-height: auto;
    }

    .login-bg,
    .login-left {
        display: none;
    }

    .login-card {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 430px;
        margin: auto;
        border-radius: 24px;
        padding: 24px;
    }

    .login-card::before {
        content: "";
        display: block;
        width: 180px;
        height: 70px;
        margin: 0 auto 18px;
        background: url("../images/my6996.png") center center / contain no-repeat;
    }
}

@media (max-width: 700px) {
    .section-head {
        display: block;
    }

    .section-head .btn {
        margin-top: 14px;
        width: 100%;
    }

    .compact-form .form-group,
    .att-edit-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .compact-form .form-group label,
    .att-edit-row > label {
        text-align: left;
    }

    .compact-form .form-group small {
        grid-column: 1;
    }

    .modal-form {
        padding: 16px;
    }

    .modal-actions {
        display: block;
    }

    .modal-actions .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .user-filter-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .user-filter-row .input,
    .user-filter-row .btn {
        width: 100%;
        max-width: none;
        margin-bottom: 0;
    }
    
    .user-filter-row a.btn {
        width: 100%;
    }

    .grid-2,
    .grid-4,
    .dashboard-stat-row,
    .dashboard-punch-grid,
    .attendance-summary-row {
        grid-template-columns: 1fr;
    }

    .attendance-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .att-edit-grid-2 {
        grid-template-columns: 1fr;
        margin-left: 0;
    }

    .att-edit-section-title {
        margin-left: 0;
    }

    .employee-select {
        min-width: 0;
    }

    .modal-overlay {
        align-items: flex-start;
        padding: 88px 14px 18px;
        overflow-y: auto;
    }

    .modal-box {
        width: 100%;
        max-width: none;
        max-height: calc(100vh - 110px);
        margin-top: 0;
        border-radius: 16px;
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #fff;
        border-radius: 16px 16px 0 0;
    }

    .modal-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        border: 1px solid var(--border);
        color: #111827;
    }

    .notice-toast {
        left: 14px;
        right: 14px;
        bottom: 14px;
        width: auto;
    }

    .notice-toast-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .notice-toast-actions .btn {
        width: 100%;
    }
    
    .card {
        overflow: hidden;
    }
    
    .duty-agent-box,
    .dashboard-duty-box {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    
    .duty-agent-row,
    .dashboard-duty-row {
        min-width: 0;
        max-width: 100%;
    }
}

.mt-14 {
    margin-top: 14px;
}

.mb-10 {
    margin-bottom: 10px;
}

.page-section {
    margin-top: 20px;
}

.modal-body {
    padding: 18px;
}

.modal-intro {
    margin-top: 0;
}

.textarea-copy {
    height: 190px;
    resize: none;
    line-height: 1.5;
}

.inline-form {
    display: inline;
}

.user-action-col {
    width: 150px;
}

.page-section {
    margin-top: 20px;
}

.log-filter-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(220px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
}

.log-filter-search {
    min-width: 220px;
}

.date-range-control {
    position: relative;
}

.date-range-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fff;
}

.date-range-icon {
    opacity: 0.7;
    font-size: 13px;
}

.date-range-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 520px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border: 1px solid #dfe6f1;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    padding: 14px;
}

.date-range-popover.show {
    display: grid;
    gap: 14px;
}

.date-range-quick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.date-range-quick button {
    border: 1px solid #dfe6f1;
    background: #f8fafc;
    color: #334155;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.date-range-quick button:hover {
    background: #eef4ff;
    color: #2563eb;
}

.date-range-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.date-range-fields label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
}

.date-range-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.log-description-col,
.log-description-cell {
    min-width: 280px;
}

.log-message-col {
    min-width: 320px;
}

.log-action-col {
    width: 90px;
}

.table-note {
    margin-top: 12px;
}

.telegram-log-textarea-message {
    height: 180px;
    resize: none;
}

.telegram-log-textarea-response {
    height: 160px;
    resize: none;
}

@media (max-width: 1200px) {
    .log-filter-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .date-range-popover {
        left: 0;
        right: auto;
    }
}

@media (max-width: 700px) {
    .log-filter-row {
        grid-template-columns: 1fr;
    }

    .date-range-popover {
        width: 100%;
        max-width: none;
    }

    .date-range-quick,
    .date-range-fields {
        grid-template-columns: 1fr;
    }
}

.table-footer-control {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    font-size: 13px;
}

.table-limit-form {
    display: flex;
    align-items: center;
}

.table-limit-select {
    width: 110px;
    height: 36px;
}

.telegram-log-filter-row {
    grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 1fr) minmax(180px, 1fr) minmax(220px, 1fr) auto auto;
}

.form-group.is-hidden {
    display: none !important;
}

/* =========================================================
   LOG PAGE MOBILE FIX
========================================================= */

@media (max-width: 900px) {
    .log-filter-row,
    .telegram-log-filter-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .log-filter-row .input,
    .telegram-log-filter-row .input,
    .log-filter-row .btn,
    .telegram-log-filter-row .btn,
    .log-filter-row a.btn,
    .telegram-log-filter-row a.btn {
        width: 100% !important;
        max-width: none !important;
    }

    .date-range-control {
        width: 100% !important;
    }

    .date-range-toggle {
        width: 100% !important;
    }

    .date-range-popover {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .table-footer-control {
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .table-limit-form,
    .table-limit-select {
        width: 100% !important;
    }
}