/* ============================================================
   DESIGN SYSTEM & CORE CONFIGS
   ============================================================ */
:root {
    --clr-xp-blue: #0058e6;
    --clr-xp-blue-light: #3a93ff;
    --clr-xp-taskbar: #245edb;
    --clr-xp-start-green: #3c9b24;
    --clr-xp-start-green-hover: #4cb814;
    --clr-xp-bg-grey: #ece9d8;
    --clr-xp-border-grey: #d6d3c2;
    --clr-xp-sidebar-light: #b2cbff;
    --clr-xp-sidebar-dark: #7aa1e6;

    /* Modern Theme Variables */
    --clr-primary: #1BAB9A;
    --clr-primary-dark: #15887A;
    --clr-primary-light: #26C7B4;
    --clr-primary-bg: #E6F7F5;
    --clr-text: #2D2D2D;
    --clr-text-muted: #666666;
    --clr-text-light: #999999;
    --clr-white: #FFFFFF;
    --clr-bg-off: #F8FAFA;
    --radius-md: 14px;
    --radius-full: 9999px;
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--clr-bg-off);
    color: var(--clr-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================
   VISIBILITY CONFIGURATION
   ============================================================ */
.xp-desktop-mode {
    display: none; /* Hidden by default, shown on desktop only */
}

.modern-card-mode {
    display: block; /* Shown by default, hidden on desktop */
}

/* Desktop screen media query */
@media screen and (min-width: 1025px) {
    .xp-desktop-mode {
        display: block;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        position: relative;
    }

    .modern-card-mode {
        display: none !important;
    }
}

/* ============================================================
   WINDOWS XP DESKTOP INTERFACE STYLES
   ============================================================ */
.xp-desktop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 30px;
    background: #008080 url('/assets/xp_bliss_wallpaper.png') no-repeat center center;
    background-size: cover;
    overflow: hidden;
    padding: 20px;
    user-select: none;
}

/* Grayscale desktop screen effect for Shutdown dialog */
.xp-desktop.shutdown-grayscale {
    filter: grayscale(85%) contrast(80%) brightness(50%);
    transition: filter 0.8s ease-in-out;
}

.xp-desktop-icons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 90px;
    height: 100%;
}

.xp-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 3px;
    border: 1px solid transparent;
    transition: background 0.1s, border 0.1s;
}

.xp-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.xp-icon.selected {
    background: rgba(49, 106, 197, 0.5);
    border: 1px solid rgba(49, 106, 197, 0.8);
}

.xp-icon img {
    width: 32px;
    height: 32px;
    margin-bottom: 6px;
    filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.5));
}

.xp-icon span {
    color: white;
    font-size: 11px;
    font-family: Tahoma, sans-serif;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- WINDOW FRAME --- */
.xp-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--clr-xp-bg-grey);
    border: 3px solid var(--clr-xp-blue);
    border-top: none;
    border-radius: 7px 7px 0 0;
    box-shadow: 3px 3px 12px rgba(0,0,0,0.4);
    font-family: Tahoma, sans-serif;
    font-size: 11px;
    z-index: 10;
}

.xp-window.minimized {
    display: none !important;
}

.xp-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 0px) !important;
    border-radius: 0;
    border: none;
}

.xp-window-titlebar {
    background: linear-gradient(to bottom, #0058e6 0%, #3a93ff 9%, #0058e6 20%, #0058e6 90%, #193ebd 100%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 4px 6px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px 4px 0 0;
    cursor: move;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.4);
}

.xp-window.inactive {
    border-color: #7b9ebd;
}

.xp-window.inactive .xp-window-titlebar {
    background: linear-gradient(to bottom, #7b9ebd 0%, #b8d2ed 9%, #7b9ebd 20%, #7b9ebd 90%, #5d7e9b 100%);
}

.xp-title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.xp-window-icon {
    width: 16px;
    height: 16px;
}

.xp-title-controls {
    display: flex;
    gap: 3px;
    align-items: center;
}

.xp-btn-control {
    width: 21px;
    height: 21px;
    border: 1px solid #ffffff;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(0,0,0,0.3);
    position: relative;
    outline: none;
}

.xp-minimize {
    background: linear-gradient(to bottom, #7da2e9 0%, #3264d8 50%, #1946b5 100%);
}

.xp-minimize::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 8px;
    height: 3px;
    background: white;
}

.xp-maximize {
    background: linear-gradient(to bottom, #7da2e9 0%, #3264d8 50%, #1946b5 100%);
}

.xp-maximize::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 9px;
    height: 8px;
    border: 2px solid white;
    border-top-width: 3px;
}

.xp-close {
    background: linear-gradient(to bottom, #f3977c 0%, #e04318 45%, #b92b07 100%);
    border-color: #ae3315;
}

.xp-close::after, .xp-close::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 4px;
    width: 10px;
    height: 2px;
    background: white;
    transform: rotate(45deg);
}

.xp-close::before {
    transform: rotate(-45deg);
}

.xp-btn-control:hover {
    filter: brightness(1.2);
}

.xp-btn-control:active {
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
    filter: brightness(0.9);
}

/* --- WINDOW MENU BAR --- */
.xp-window-menubar {
    display: flex;
    background: var(--clr-xp-bg-grey);
    padding: 3px 10px;
    border-bottom: 1px solid #d6d3c2;
    gap: 12px;
    color: black;
}

.xp-window-menubar span {
    cursor: pointer;
    padding: 2px 5px;
}

.xp-window-menubar span:hover {
    background: #316ac5;
    color: white;
    border-radius: 2px;
}

/* --- TOOLBAR --- */
.xp-window-toolbar {
    background: var(--clr-xp-bg-grey);
    border-bottom: 1px solid #d6d3c2;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.xp-tool-btn {
    border: 1px solid transparent;
    background: transparent;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: Tahoma, sans-serif;
    font-size: 11px;
    border-radius: 3px;
    color: #333;
}

.xp-tool-btn:hover {
    background: #ffffff;
    border-color: #b5b2a0;
    box-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.xp-tool-btn:active {
    background: #e6e5db;
    box-shadow: inset 1px 1px 1px rgba(0,0,0,0.15);
}

.xp-tool-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.xp-tool-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.back-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23388a0e'><path d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/></svg>");
}

.forward-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'><path d='M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z'/></svg>");
}

.up-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff9900'><path d='M4 20h16V8H4v12zM4 6h6l2 2h8v2H4V6z'/></svg>");
}

.search-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230066cc'><path d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/></svg>");
}

.folders-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffcc00'><path d='M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/></svg>");
}

.xp-tool-separator {
    width: 1px;
    height: 22px;
    background: #b5b2a0;
    margin: 0 4px;
}

/* --- ADDRESS BAR --- */
.xp-window-addressbar {
    background: var(--clr-xp-bg-grey);
    border-bottom: 1px solid #9c9a88;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-label {
    color: #7f7f7f;
    font-size: 11px;
}

.address-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #7f9db9;
    padding: 2px 5px;
    height: 22px;
}

.address-folder-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.address-input-wrapper input {
    width: 100%;
    border: none;
    outline: none;
    font-family: Tahoma, sans-serif;
    font-size: 11px;
    color: #333;
}

.xp-go-btn {
    padding: 2px 10px;
    background: linear-gradient(to bottom, #ffffff 0%, #ece9d8 100%);
    border: 1px solid #7f9db9;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    height: 22px;
}

.xp-go-btn:hover {
    background: #e6e5db;
}

/* --- EXPLORER CONTENT LAYOUT --- */
.xp-window-content {
    display: flex;
    flex: 1;
    min-height: 0;
    background: white;
    position: relative;
    overflow: hidden;
}

.xp-sidebar {
    width: 230px;
    background: linear-gradient(to bottom, var(--clr-xp-sidebar-light) 0%, var(--clr-xp-sidebar-dark) 100%);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    border-right: 1px solid #6c8ec6;
    flex-shrink: 0;
    height: 100%;
    min-height: 0;
}

/* Explorer sidebar panes style */
.xp-sidebar-pane {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #ffffff;
    border-radius: 5px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.details-pane {
    flex: 1 1 0%;
    min-height: 0;
}

.xp-sidebar-header {
    background: linear-gradient(to right, #ffffff 0%, #c7d9f5 100%);
    color: #215dc6;
    font-weight: bold;
    padding: 5px 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dcdcdc;
    font-size: 11px;
}

.xp-sidebar-header:hover {
    color: #1c52b5;
}

.xp-sidebar-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.xp-sidebar-pane.collapsed .xp-sidebar-body {
    display: none;
}

.xp-sidebar-pane.collapsed .xp-sidebar-header .arrow {
    transform: rotate(180deg);
}

.xp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.xp-filter-group label {
    font-weight: bold;
    color: #4c4c4c;
}

.xp-filter-group input[type="text"],
.xp-filter-group select {
    padding: 2px 4px;
    border: 1px solid #7f9db9;
    outline: none;
    font-family: Tahoma, sans-serif;
    font-size: 11px;
}

.xp-filter-group.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}

.xp-filter-group.checkbox-group label {
    font-weight: normal;
    cursor: pointer;
}

.xp-sidebar-links {
    list-style: none;
}

.xp-sidebar-links li {
    padding: 3px 0 3px 14px;
    position: relative;
}

.xp-sidebar-links li::before {
    content: "•";
    color: #215dc6;
    position: absolute;
    left: 2px;
    top: 1px;
    font-size: 12px;
}

.xp-sidebar-links a {
    color: #215dc6;
    text-decoration: none;
}

.xp-sidebar-links a:hover {
    text-decoration: underline;
    color: #10419e;
}

/* Details Panel */
.details-pane .xp-sidebar-body {
    font-size: 11px;
    word-break: break-word;
    flex: 1 1 0%;
    overflow-y: auto;
    min-height: 0;
    max-height: none;
}

.xp-sidebar-body > *:last-child {
    margin-bottom: 10px;
}

.empty-details {
    color: #808080;
    font-style: italic;
    text-align: center;
    padding: 10px 0;
}

.detail-item {
    margin-bottom: 5px;
}

.detail-label {
    font-weight: bold;
    color: #555;
}

.detail-value {
    color: #000;
}

.xp-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.xp-tag {
    display: inline-block;
    background-color: #f4f6fb;
    border: 1px solid #7aa1e6;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    color: #215dc6;
    word-break: break-word;
}

.detail-title-val {
    font-weight: bold;
    color: #215dc6;
    margin-bottom: 6px;
    font-size: 12px;
}

/* File/Folder content panel */
.xp-file-view {
    flex: 1;
    overflow-y: auto;
    background: white;
    padding: 15px;
    position: relative;
    height: 100%;
    min-height: 0;
}

.xp-loading-view {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #666;
}

.xp-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #7aa1e6;
    border-top: 3px solid #0058e6;
    border-radius: 50%;
    animation: xp-spin 1s linear infinite;
}

@keyframes xp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.xp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px 10px;
    align-content: flex-start;
}

.xp-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 8px 4px;
    border-radius: 3px;
    user-select: none;
    position: relative; /* Added relative positioning for status tags */
}

.xp-grid-item:hover {
    background-color: #e5f3ff;
    border-color: #cde6fd;
}

.xp-grid-item.selected {
    background-color: #cce8ff;
    border-color: #99d1ff;
}

.xp-grid-item .item-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.xp-grid-item .item-icon.folder {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path d='M6 8h14l4 4h18v28H6z' fill='%23ffcc66' stroke='%23d4a017' stroke-width='2'/><path d='M8 14h32v24H8z' fill='%23ffffff'/></svg>");
}

.xp-grid-item .item-icon.file-doc {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><rect x='10' y='6' width='28' height='36' rx='2' fill='%23ffffff' stroke='%230058e6' stroke-width='2'/><line x1='16' y1='14' x2='32' y2='14' stroke='%230058e6' stroke-width='2'/><line x1='16' y1='22' x2='32' y2='22' stroke='%230058e6' stroke-width='2'/><line x1='16' y1='30' x2='26' y2='30' stroke='%230058e6' stroke-width='2'/></svg>");
}

/* Distinct icons for active, upcoming, and expired document status */
.xp-grid-item .item-icon.file-doc.status-active {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><rect x='10' y='6' width='28' height='36' rx='2' fill='%23ffffff' stroke='%2310b981' stroke-width='2.5'/><line x1='16' y1='14' x2='32' y2='14' stroke='%2310b981' stroke-width='2.5'/><line x1='16' y1='22' x2='32' y2='22' stroke='%2310b981' stroke-width='2.5'/><line x1='16' y1='30' x2='26' y2='30' stroke='%2310b981' stroke-width='2.5'/></svg>");
}

.xp-grid-item .item-icon.file-doc.status-upcoming {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><rect x='10' y='6' width='28' height='36' rx='2' fill='%23ffffff' stroke='%23f59e0b' stroke-width='2.5'/><line x1='16' y1='14' x2='32' y2='14' stroke='%23f59e0b' stroke-width='2.5'/><line x1='16' y1='22' x2='32' y2='22' stroke='%23f59e0b' stroke-width='2.5'/><line x1='16' y1='30' x2='26' y2='30' stroke='%23f59e0b' stroke-width='2.5'/></svg>");
}

.xp-grid-item .item-icon.file-doc.status-expired {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><rect x='10' y='6' width='28' height='36' rx='2' fill='%23f9fafb' stroke='%23ef4444' stroke-width='2.5'/><line x1='16' y1='14' x2='32' y2='14' stroke='%23ef4444' stroke-width='2.5'/><line x1='16' y1='22' x2='32' y2='22' stroke='%23ef4444' stroke-width='2.5'/><line x1='16' y1='30' x2='26' y2='30' stroke='%23ef4444' stroke-width='2.5'/><path d='M28 8 L38 18' stroke='%23ef4444' stroke-width='2.5'/></svg>");
}

/* XP Explorer Document Status Tag styles */
.xp-status-tag {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 7.5px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 2px;
    color: white;
    text-shadow: none;
    line-height: 1;
    text-transform: uppercase;
}

.xp-status-tag.status-active {
    background-color: #10b981;
}

.xp-status-tag.status-upcoming {
    background-color: #f59e0b;
}

.xp-status-tag.status-expired {
    background-color: #ef4444;
}

.xp-grid-item .item-name {
    font-size: 11px;
    color: black;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Status Bar */
.xp-window-statusbar {
    background: var(--clr-xp-bg-grey);
    border-top: 1px solid #a6a495;
    padding: 3px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: black;
    height: 22px;
}

/* --- NOTEPAD WINDOW --- */
.notepad-window {
    border-color: #15887A; /* Different tint for helper window */
}

.notepad-content {
    background: white;
    overflow: hidden;
}

.notepad-paper {
    width: 100%;
    height: 100%;
    padding: 15px;
    background: #ffffff;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #000000;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Notepad detailed content formatting */
.np-title {
    font-weight: bold;
    font-size: 16px;
    border-bottom: 2px dashed #333;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.np-meta {
    margin-bottom: 15px;
    background: #f5f5f5;
    padding: 10px;
    border: 1px solid #ddd;
}

.np-summary {
    margin-bottom: 20px;
    white-space: pre-line;
}

.np-cases {
    margin-bottom: 20px;
}

.np-case-item {
    padding-left: 15px;
    position: relative;
    margin-bottom: 5px;
}

.np-case-item::before {
    content: "[x]";
    position: absolute;
    left: 0;
    font-size: 11px;
}

.np-link-btn {
    display: inline-block;
    background: #000;
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    font-weight: bold;
    margin-top: 10px;
}

.np-link-btn:hover {
    background: #333;
}

/* ============================================================
   START MENU & SHUTDOWN DIALOG
   ============================================================ */
.xp-start-menu {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 380px;
    background: #245edb;
    border: 2px solid #245edb;
    border-radius: 5px 5px 0 0;
    box-shadow: 3px -3px 12px rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.xp-start-header {
    background: linear-gradient(to bottom, #193ebd 0%, #245edb 100%);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #183a99;
}

.xp-user-avatar {
    width: 36px;
    height: 36px;
    border: 2px solid #ffffff;
    border-radius: 3px;
    background: #1bab9a url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'><path d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") no-repeat center center;
    background-size: cover;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.xp-user-name {
    color: white;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.xp-start-content {
    display: flex;
    background: #ffffff;
    height: 280px;
}

.xp-start-left {
    flex: 1.1;
    background: white;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xp-start-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 3px;
}

.xp-start-item:hover {
    background-color: #316ac5;
    color: white !important;
}

.xp-start-item:hover .start-item-title {
    color: white;
}

.xp-start-item:hover .start-item-desc {
    color: #d3e5fa;
}

.start-item-icon {
    width: 24px;
    height: 24px;
}

.start-item-text {
    display: flex;
    flex-direction: column;
}

.start-item-title {
    font-weight: bold;
    font-size: 11px;
    color: #333;
}

.start-item-desc {
    font-size: 9px;
    color: #777;
}

.xp-start-separator {
    height: 1px;
    background-color: #e5e5e5;
    margin: 5px 0;
}

.xp-start-right {
    flex: 0.9;
    background: #d3e5fa;
    border-left: 1px solid #95b3de;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xp-start-right-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: #002d96;
    font-weight: 500;
}

.xp-start-right-item:hover {
    background-color: #316ac5;
    color: white;
}

.item-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.doc-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path d='M6 8h14l4 4h18v28H6z' fill='%23ffcc66'/></svg>"); }
.comp-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><rect x='6' y='6' width='36' height='26' fill='%232596be'/></svg>"); }
.cp-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'><path d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/></svg>"); }
.search-small-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'><path d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/></svg>"); }
.help-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666666'><path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 16h-2v-2h2v2zm1.07-7.75l-.9.92C12.45 11.9 12 12.5 12 14h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H7c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.04-.42 1.99-1.07 2.75z'/></svg>"); }

.xp-start-footer {
    background: linear-gradient(to bottom, #245edb 0%, #193ebd 100%);
    padding: 8px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #183a99;
}

.xp-footer-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.xp-footer-btn:hover {
    color: #ffcc00;
}

.logoff-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffcc00'><path d='M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z'/></svg>");
    background-size: contain;
}

.shutdown-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e04318'><path d='M13 3h-2v10h2V3zm4.83 2.17l-1.42 1.42C18.3 8.4 19 10.1 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-1.9.7-3.6 1.59-4.41L5.17 5.17C3.81 6.89 3 9.35 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.65-.81-5.11-2.17-6.83z'/></svg>");
    background-size: contain;
}

/* Shutdown overlay styles */
.xp-shutdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xp-shutdown-dialog {
    width: 300px;
    background: #002d96;
    border: 1px solid #ffffff;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    color: white;
    font-family: Tahoma, sans-serif;
    overflow: hidden;
}

.xp-shutdown-header {
    background: linear-gradient(to right, #002d96 0%, #0058e6 50%, #002d96 100%);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.xp-shutdown-header span {
    font-weight: bold;
    font-size: 13px;
}

.xp-shutdown-header .logo {
    font-size: 11px;
    font-weight: bold;
}

.xp-shutdown-header .logo span {
    color: #ff6600;
    font-style: italic;
    font-size: 12px;
    margin-left: 2px;
}

.xp-shutdown-buttons {
    background: linear-gradient(to right, #002d96 0%, #0058e6 50%, #002d96 100%);
    padding: 20px 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.shutdown-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 80px;
    cursor: pointer;
}

.shutdown-btn-container span {
    font-size: 10px;
    text-align: center;
}

.shutdown-btn-container:hover span {
    text-decoration: underline;
}

.shutdown-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    position: relative;
}

.standby-circle {
    background: radial-gradient(circle, #ffe680 0%, #ffcc00 100%);
}

.standby-circle::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 11px;
    width: 6px;
    height: 14px;
    border: 2px solid white;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
}

.turnoff-circle {
    background: radial-gradient(circle, #ff6666 0%, #e04318 100%);
}

.turnoff-circle::after {
    content: "";
    position: absolute;
    top: 7px;
    left: 13px;
    width: 2px;
    height: 12px;
    background: white;
}

.restart-circle {
    background: radial-gradient(circle, #85e085 0%, #3c9b24 100%);
}

.restart-circle::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-radius: 50%;
    border-right-color: transparent;
    transform: rotate(45deg);
}

.xp-shutdown-footer {
    background: #002d96;
    padding: 8px 12px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.xp-shutdown-footer button {
    padding: 3px 12px;
    background: linear-gradient(to bottom, #ffffff 0%, #ece9d8 100%);
    border: 1px solid #ffffff;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
}

.xp-shutdown-footer button:hover {
    background: #e6e5db;
}

/* Shutdown black screen */
.xp-safe-turnoff {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.safe-turnoff-text {
    font-family: "Courier New", monospace;
    color: #ff9900;
    font-size: 20px;
    text-align: center;
    line-height: 1.8;
}

/* --- TASKBAR --- */
.xp-taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, #245edb 0%, #3f8cf3 9%, #245edb 18%, #245edb 92%, #193ebd 100%);
    display: flex;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.3);
}

.xp-start-btn {
    height: 100%;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 16px 0 10px;
    background: linear-gradient(to bottom, #388a0e 0%, #4cb814 8%, #3c9b24 25%, #3c9b24 75%, #20500a 100%);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    color: white;
    font-weight: 800;
    font-style: italic;
    font-size: 15px;
    text-shadow: 1px 1px 1px #0f3000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
}

.xp-start-btn:hover {
    background: linear-gradient(to bottom, #4cb814 0%, #5cd322 8%, #4cb814 25%, #4cb814 75%, #2f6b12 100%);
}

.xp-start-logo {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='2' y='2' width='9' height='9' fill='%23f25022'/><rect x='13' y='2' width='9' height='9' fill='%237fba00'/><rect x='2' y='13' width='9' height='9' fill='%2301a6f0'/><rect x='13' y='13' width='9' height='9' fill='%23ffb900'/></svg>") no-repeat center center;
    background-size: contain;
}

.xp-taskbar-tasks {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    height: 100%;
}

.xp-taskbar-item {
    height: 22px;
    max-width: 150px;
    min-width: 80px;
    background: #3c81f3;
    border: 1px solid #245edb;
    border-radius: 3px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-family: Tahoma, sans-serif;
    font-size: 10px;
    cursor: pointer;
    outline: none;
    box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
}

.xp-taskbar-item:hover {
    background: #5393ff;
}

.xp-taskbar-item.active {
    background: #1e52c9;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
    border-color: #1946b5;
}

.xp-taskbar-item .task-icon {
    width: 14px;
    height: 14px;
}

.xp-taskbar-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xp-systray {
    height: 100%;
    background: linear-gradient(to bottom, #0c9be7 0%, #10a8ef 10%, #0c9cfa 25%, #0076a3 88%, #005f84 100%);
    border-left: 1px solid #10a8ef;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 1px 0 1px rgba(255,255,255,0.3);
}

.tray-icon {
    width: 14px;
    height: 14px;
    opacity: 0.85;
    cursor: pointer;
}

.tray-icon:hover {
    opacity: 1;
}

.xp-clock {
    color: white;
    font-family: Tahoma, sans-serif;
    font-size: 11px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    margin-left: 5px;
}


/* ============================================================
   MODERN CARD-BASED THEME (Mobile & Tablet)
   ============================================================ */
.modern-header {
    background-color: var(--clr-white);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modern-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--clr-text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--clr-primary);
}

.header-tag {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    background: var(--clr-primary-bg);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* --- STATS SECTION --- */
.modern-stats-section {
    padding: 24px 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

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

@media screen and (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(9, 1fr);
    }
}

.stat-card {
    background: var(--clr-white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 12px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--clr-primary-light);
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--clr-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--clr-text-light);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.text-success { color: #10B981; }
.text-warning { color: #F59E0B; }
.text-danger { color: #EF4444; }

/* --- CONTROLS SECTION --- */
.modern-controls-section {
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.controls-container {
    background: var(--clr-white);
    padding: 15px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
}

/* Search */
.modern-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.search-icon-svg {
    position: absolute;
    left: 15px;
    color: var(--clr-primary);
    display: flex;
    align-items: center;
}

.modern-search-wrapper input {
    width: 100%;
    padding: 14px 110px 14px 45px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-full);
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    background-color: var(--clr-bg-off);
    transition: border-color 0.2s, background-color 0.2s;
}

.modern-search-wrapper input:focus {
    border-color: var(--clr-primary);
    background-color: var(--clr-white);
}

.search-count {
    position: absolute;
    right: 15px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--clr-text-muted);
}

/* Tabs scroll */
.modern-tabs-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.modern-tabs-scroll::-webkit-scrollbar {
    height: 4px;
}

.modern-tabs-scroll::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.modern-tabs {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid rgba(0,0,0,0.06);
    background: var(--clr-bg-off);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(27,171,154,0.08);
}

.tab-btn.active {
    background: var(--clr-primary);
    color: var(--clr-white);
    border-color: var(--clr-primary);
}

/* Select rows */
.modern-selects-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modern-selects-row select {
    padding: 8px 16px;
    border: 1px solid rgba(0,0,0,0.08);
    background: var(--clr-white);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-text);
    outline: none;
    cursor: pointer;
    min-width: 130px;
}

.toggle-btn {
    padding: 8px 16px;
    border: 1px solid #F59E0B;
    background: rgba(245, 158, 11, 0.05);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: #D97706;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #F59E0B;
    color: var(--clr-white);
}

/* --- MAIN LAYOUT --- */
.modern-main-content {
    padding: 10px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.modern-layout-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media screen and (min-width: 992px) {
    .modern-layout-container {
        flex-direction: row;
    }

    .modern-sidebar {
        width: 250px;
        flex-shrink: 0;
    }

    .modern-cards-column {
        flex: 1;
    }
}

/* Sidebar Lĩnh vực */
.category-panel {
    background: var(--clr-white);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
}

.category-panel-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--clr-text-light);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
}

@media screen and (min-width: 992px) {
    .category-list {
        flex-direction: column;
        overflow-x: visible;
        padding-bottom: 0;
    }
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--clr-bg-off);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    transition: all 0.2s;
    white-space: nowrap;
}

@media screen and (min-width: 992px) {
    .category-item {
        background: transparent;
        padding: 10px 12px;
        border-radius: 10px;
    }
}

.category-item:hover {
    background: var(--clr-primary-bg);
    color: var(--clr-primary-dark);
}

.category-item.active {
    background: var(--clr-primary);
    color: var(--clr-white);
}

.category-item .badge {
    background: rgba(0,0,0,0.05);
    color: inherit;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.category-item.active .badge {
    background: rgba(255,255,255,0.2);
}

/* Document cards column */
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-main-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--clr-text);
}

.results-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--clr-text-muted);
}

.modern-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 0;
    color: var(--clr-text-light);
}

.modern-loading .spinner {
    width: 25px;
    height: 25px;
    border: 2px solid var(--clr-primary-bg);
    border-top-color: var(--clr-primary);
    border-radius: 50%;
    animation: xp-spin 0.8s linear infinite;
}

.modern-cards-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media screen and (min-width: 768px) {
    .modern-cards-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Document Card Styling */
.modern-card {
    background: var(--clr-white);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modern-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.badge-type {
    background: var(--clr-primary-bg);
    color: var(--clr-primary-dark);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-status.status-active {
    background: rgba(16, 185, 129, 0.08);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-status.status-upcoming {
    background: rgba(245, 158, 11, 0.08);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.badge-status.status-expired {
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--clr-text);
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.meta-col {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--clr-text-light);
    margin-bottom: 2px;
}

.meta-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--clr-text);
}

.card-summary {
    font-size: 0.82rem;
    color: var(--clr-text-muted);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.card-replaced {
    font-size: 0.72rem;
    font-weight: 600;
    color: #b45309;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    margin-top: auto;
}

.card-action-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--clr-primary);
    color: var(--clr-white);
    padding: 10px 16px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: auto;
}

.card-action-btn:hover {
    background: var(--clr-primary-dark);
}

/* --- DETAIL MODAL SHEET --- */
.modern-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.modal-content-wrapper {
    position: relative;
    background: var(--clr-white);
    width: 100%;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
    z-index: 10;
    animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media screen and (min-width: 768px) {
    .modern-modal {
        align-items: center;
        justify-content: center;
    }

    .modal-content-wrapper {
        width: 550px;
        border-radius: 20px;
        max-height: 80vh;
    }
}

.modal-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.modal-badge-type {
    background: var(--clr-primary-bg);
    color: var(--clr-primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.modal-badge-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.modal-close-btn {
    position: absolute;
    right: 0;
    top: -5px;
    background: var(--clr-bg-off);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--clr-text-muted);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--clr-text);
    margin-bottom: 18px;
    line-height: 1.4;
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: var(--clr-bg-off);
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.modal-section {
    margin-bottom: 18px;
}

.modal-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--clr-text-light);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.modal-section-content {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    line-height: 1.6;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.modal-tags span {
    background: rgba(0,0,0,0.04);
    color: var(--clr-text);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.relation-box {
    font-size: 0.8rem;
    font-weight: 600;
    color: #b45309;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.15);
    padding: 10px 14px;
    border-radius: 10px;
}

.modal-footer {
    margin-top: 25px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 18px;
}

.modal-action-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--clr-primary);
    color: var(--clr-white);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background 0.2s;
}

.modal-action-btn:hover {
    background: var(--clr-primary-dark);
}

.modern-footer {
    background: var(--clr-text);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 24px 20px;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
