/* Modern UI enhancements — layered on app.css v2 */

:root {
    --gradient-primary: linear-gradient(135deg, #5b5ef4 0%, #6d28d9 50%, #5b21b6 100%);
    --gradient-employee: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #0f766e 100%);
    --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --glass: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(226, 232, 240, 0.8);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 94, 244, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.04), transparent),
        var(--bg);
}

/* ---- Motion ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.page-content.page-enter {
    animation: fadeInUp 0.45s var(--ease-out) both;
}

.page-content.page-enter > * {
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.page-content.page-enter > *:nth-child(1) { animation-delay: 0.04s; }
.page-content.page-enter > *:nth-child(2) { animation-delay: 0.08s; }
.page-content.page-enter > *:nth-child(3) { animation-delay: 0.12s; }
.page-content.page-enter > *:nth-child(4) { animation-delay: 0.16s; }

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Sidebar ---- */
.nav-link {
    position: relative;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 55%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.emp-layout .nav-link.active::before {
    background: var(--primary);
}

/* ---- Topbar ---- */
.topbar {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.topbar h1 {
    letter-spacing: -0.02em;
}

/* ---- Search field ---- */
.search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field-icon {
    position: absolute;
    left: 0.75rem;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
    transition: color var(--transition);
}

.search-field input[type="search"] {
    padding-left: 2.35rem !important;
    border-radius: 999px !important;
    background: var(--bg) !important;
    border: 1px solid transparent !important;
    transition: all 0.25s var(--ease-out) !important;
}

.search-field input[type="search"]:focus {
    background: var(--surface) !important;
    border-color: var(--primary) !important;
    box-shadow: var(--focus-ring), var(--shadow-md) !important;
}

.search-field:focus-within .search-field-icon {
    color: var(--primary);
}

.search-field .search-autocomplete-wrap {
    width: 100%;
}

.search-field .search-autocomplete-wrap input {
    width: 100%;
}

.topbar-search.search-field {
    min-width: 220px;
}

.search-kbd-hint {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    pointer-events: none;
    opacity: 0.7;
}

.topbar-search .search-kbd-hint { display: none; }

@media (min-width: 1100px) {
    .topbar-search .search-kbd-hint { display: block; }
}

/* ---- Buttons ---- */
.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient-primary);
}

/* ---- Cards & stats ---- */
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(91, 94, 244, 0.12), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ---- Article cards ---- */
.article-card {
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.25s var(--ease-out);
}

.article-card:hover::before {
    opacity: 1;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.article-card h3 {
    transition: color 0.2s;
}

.article-card:hover h3 {
    color: var(--primary);
}

/* ---- Hero (employee) ---- */
.hero-modern {
    position: relative;
    background: var(--gradient-employee);
    border-radius: calc(var(--radius) + 4px);
    padding: 2.25rem 2rem;
    margin-bottom: 1.75rem;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(13, 148, 136, 0.25);
}

.hero-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.hero-modern-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.85rem;
    backdrop-filter: blur(4px);
}

.hero-modern h2 {
    margin: 0 0 0.4rem;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero-modern p {
    margin: 0 0 1.25rem;
    opacity: 0.9;
    font-size: 0.95rem;
    max-width: 520px;
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hero-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero-stat-label {
    font-size: 0.75rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-search-wrap {
    max-width: 480px;
}

.hero-search-wrap .search-field input {
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    font-size: 0.95rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

.hero-search-wrap .search-field input:focus {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18) !important;
}

.hero-search-wrap .search-field-icon {
    color: #64748b;
}

/* ---- Pills ---- */
.category-pill,
.tag-pill {
    transition: all 0.2s var(--ease-out);
}

.category-pill:hover,
.tag-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-pill.active,
.tag-pill.active {
    box-shadow: 0 4px 12px rgba(79, 70, 241, 0.25);
}

/* ---- Search autocomplete ---- */
.search-hero-form,
.topbar-search.search-field,
.filters-bar .search-field {
    position: relative;
    z-index: 30;
}

.search-autocomplete-dropdown {
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
    animation: fadeInUp 0.2s var(--ease-out) both;
    overflow: hidden;
}

/* Keep suggestions above following page content (empty-state cards, etc.) */
.search-autocomplete-wrap:has(.search-autocomplete-dropdown:not([hidden])) {
    z-index: 40;
}

/* Hide idle empty prompt while suggestions are open */
.page-content:has(.search-autocomplete-dropdown:not([hidden])) > .card:has(> .empty-state) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.search-autocomplete-group-label {
    padding: 0.5rem 0.85rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.search-autocomplete-item {
    transition: background 0.15s, padding-left 0.15s;
}

.search-autocomplete-item.is-active,
.search-autocomplete-item:hover {
    padding-left: 1rem;
    background: var(--primary-light);
}

.search-autocomplete-type {
    text-transform: capitalize;
}

.search-autocomplete-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-autocomplete-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Toasts ---- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.35s var(--ease-spring) both;
    border: 1px solid transparent;
}

.toast-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.toast-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    color: inherit;
}

.toast-close:hover {
    opacity: 1;
}

/* ---- Auth ---- */
.auth-page {
    background:
        radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.12), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(20, 184, 166, 0.1), transparent 50%),
        linear-gradient(135deg, #f0f4f8 0%, #e0e7ff 100%);
}

.auth-card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.auth-brand .logo-icon {
    background: var(--gradient-primary);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

/* ---- Landing ---- */
.landing {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #4338ca 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.feature-card {
    transition: transform 0.3s var(--ease-out), background 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
}

.portal-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-card:hover {
    transform: translateY(-6px) scale(1.01);
}

/* ---- Tables ---- */
table.data-table tbody tr {
    transition: background 0.15s, transform 0.15s;
}

table.data-table tbody tr:hover {
    background: var(--primary-light);
}

/* ---- Empty states ---- */
.empty-state {
    animation: fadeIn 0.4s var(--ease-out) both;
}

.empty-icon {
    animation: pulse-soft 2.5s ease-in-out infinite;
}

/* ---- Forms focus ---- */
.filters-bar input:focus,
.filters-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-hero-input {
    transition: all 0.25s var(--ease-out);
}

.search-hero-input:focus {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), var(--shadow-md);
}

/* ---- Scrollbar ---- */
.sidebar-nav::-webkit-scrollbar,
.search-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.search-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- Articles Drive (admin) ---- */
.articles-drive-page {
    --drive-radius: 16px;
    --drive-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --drive-shadow-hover: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.articles-hero {
    position: relative;
    background: var(--gradient-primary);
    border-radius: calc(var(--radius) + 6px);
    padding: 1.75rem 1.75rem 1.5rem;
    margin-bottom: 1.25rem;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.28);
}

.articles-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 90%, rgba(255, 255, 255, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.articles-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.articles-hero-text h2 {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.articles-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.65rem;
    backdrop-filter: blur(6px);
}

.drive-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.82rem;
    opacity: 0.88;
    margin-top: 0.15rem;
}

.drive-breadcrumb a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.drive-breadcrumb a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.drive-breadcrumb-sep {
    opacity: 0.5;
    font-size: 0.75rem;
}

.drive-breadcrumb-current {
    font-weight: 600;
    padding: 0.15rem 0.4rem;
}

.articles-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.articles-hero-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    backdrop-filter: blur(4px);
}

.articles-hero-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.articles-hero-actions .btn-primary {
    background: #fff;
    color: var(--primary);
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.articles-hero-actions .btn-primary:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.view-toggle {
    display: inline-flex;
    padding: 3px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s var(--ease-out);
}

.view-toggle-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.view-toggle-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.articles-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
}

.articles-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.articles-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.articles-stat-label {
    font-size: 0.72rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.articles-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--drive-radius);
    box-shadow: var(--drive-shadow);
    margin-bottom: 1.5rem;
}

.articles-toolbar .search-field {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.articles-toolbar .search-field input {
    border-radius: 10px;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    font-size: 0.88rem;
    border-color: transparent;
    background: var(--bg);
}

.articles-toolbar .search-field input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.articles-toolbar select {
    padding: 0.55rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.articles-toolbar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--surface);
}

.drive-section {
    margin-bottom: 2rem;
}

.drive-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.drive-section-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.drive-section-count {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 1rem;
}

.drive-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--drive-radius);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.2s;
    animation: fadeInUp 0.4s var(--ease-out) both;
}

.drive-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--drive-shadow-hover);
    border-color: rgba(79, 70, 229, 0.2);
}

.drive-card-folder {
    padding: 1.15rem 1rem 1rem;
    gap: 0.85rem;
    cursor: default;
}

.drive-card-folder-link {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.drive-card-menu-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.45rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    opacity: 1;
    transition: background 0.15s, color 0.15s;
}

.drive-card-menu-btn:hover,
.drive-card-menu-btn:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
    outline: none;
}

.drive-card-menu-btn svg {
    width: 16px;
    height: 16px;
}

.drive-folder-menu {
    position: absolute;
    top: 2.35rem;
    right: 0.45rem;
    z-index: 3;
    min-width: 148px;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--drive-shadow-hover);
}

.drive-folder-menu-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.84rem;
    text-align: left;
    cursor: pointer;
}

.drive-folder-menu-item:hover,
.drive-folder-menu-item:focus {
    background: var(--surface-2, rgba(0, 0, 0, 0.04));
    outline: none;
}

.drive-folder-menu-danger {
    color: #dc2626;
}

.drive-folder-menu-danger:hover,
.drive-folder-menu-danger:focus {
    background: rgba(220, 38, 38, 0.08);
}

.drive-card-folder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent, var(--primary));
    border-radius: var(--drive-radius) var(--drive-radius) 0 0;
}

.drive-card-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent, var(--primary)) 12%, transparent);
}

.drive-card-icon-wrap svg {
    width: 26px;
    height: 26px;
    color: var(--accent, var(--primary));
}

.drive-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.drive-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.drive-card-sub {
    font-size: 0.75rem;
    color: var(--muted);
}

.drive-card-file {
    min-height: 148px;
    padding: 1rem;
    cursor: default;
}

.drive-card-file-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.drive-file-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.file-type-docs {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}

.file-type-sheets {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #047857;
}

.file-type-slides {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #c2410c;
}

.file-type-image {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #be185d;
}

.file-type-video {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #6d28d9;
}

.file-type-media {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4338ca;
}

.drive-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.drive-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.3;
}

.drive-chip-status-draft { background: #f1f5f9; color: #475569; }
.drive-chip-status-published { background: #d1fae5; color: #065f46; }
.drive-chip-status-pending_review { background: #fef3c7; color: #92400e; }
.drive-chip-status-archived { background: #f1f5f9; color: #64748b; }
.drive-chip-synced { background: #dbeafe; color: #1e40af; }
.drive-chip-unsynced { background: #fef3c7; color: #92400e; }

.drive-card-file .drive-card-title {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: color 0.15s;
}

.drive-card-file:hover .drive-card-title {
    color: var(--primary);
}

.drive-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.35) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s var(--ease-out);
    border-radius: var(--drive-radius);
}

.drive-card-file:hover .drive-card-overlay {
    opacity: 1;
}

.drive-overlay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    width: 100%;
}

.drive-overlay-actions .btn,
.drive-overlay-actions button.btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.drive-overlay-actions .btn-ghost {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}

.drive-overlay-actions .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.25);
}

.drive-overlay-actions .btn-secondary {
    background: #fff;
    color: var(--text);
    border: none;
}

.drive-empty {
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--drive-radius);
}

.drive-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.drive-empty h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.drive-empty p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 360px;
    margin-inline: auto;
}

.articles-list-card {
    border-radius: var(--drive-radius);
    overflow: hidden;
    box-shadow: var(--drive-shadow);
    border: 1px solid var(--border);
}

.articles-list-card .data-table thead th {
    background: var(--bg);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.articles-list-card .data-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.articles-list-card .data-table tbody tr {
    transition: background 0.15s;
}

.articles-list-card .data-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

@media (max-width: 768px) {
    .articles-hero {
        padding: 1.25rem;
    }

    .articles-hero-inner {
        flex-direction: column;
    }

    .articles-hero-actions {
        width: 100%;
    }

    .articles-hero-actions .btn-primary {
        flex: 1;
    }

    .drive-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .articles-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .articles-toolbar .search-field {
        max-width: none;
    }
}

/* ---- System Guide ---- */
.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.system-guide-intro {
    margin: 0 0 1.5rem;
    max-width: 52rem;
}

.system-guide-section {
    margin-bottom: 2rem;
}

.system-guide-heading {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.system-guide-section-desc {
    margin: 0 0 1rem;
}

.system-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.system-guide-role-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.system-guide-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.875rem;
    line-height: 1.55;
}

.system-guide-list li + li {
    margin-top: 0.35rem;
}

.system-guide-card-desc {
    margin: 0 0 0.75rem;
}

.checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist-item + .checklist-item,
.workflow-step + .workflow-step {
    margin-top: 0.5rem;
}

.checklist-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
}

.checklist-input {
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: var(--primary, #5b5ef4);
}

.checklist-text {
    flex: 1;
}

.checklist-link {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary, #5b5ef4);
    text-decoration: none;
}

.checklist-link:hover {
    text-decoration: underline;
}

.checklist-input:checked + .checklist-text {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: rgba(100, 116, 139, 0.5);
}

.checklist-input:checked + .checklist-text .checklist-link {
    text-decoration: none;
}

.workflow-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.workflow-step-num {
    font-weight: 600;
    color: var(--muted);
    margin-right: 0.15rem;
}

@media (max-width: 992px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .system-guide-grid {
        grid-template-columns: 1fr;
    }
}
