/* Custom CSS for TechOne Admin Panel Dashboard */
body {
    background-color: #f8fafc;
    font-family: 'Poppins', sans-serif;
    color: #1e293b;
    margin: 0;
}

/* Auth Portal */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #370b6f, #00429b);
}

.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    color: #101834;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

/* Dashboard Layout */
.admin-body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #1e1b4b;
    color: #ffffff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #312e81;
    padding-bottom: 14px;
    margin-bottom: 12px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #7b68ee;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 20px;
    padding: 6px;
    cursor: pointer;
}

.sidebar-user {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin: 0 0 18px;
}

.sidebar-user .online-dot {
    color: #4ade80;
}

.sidebar h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 40px;
    color: #7b68ee;
    text-align: center;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-menu a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    background: #312e81;
    color: #ffffff;
}

.sidebar-logout {
    margin-top: auto;
    border-top: 1px solid #312e81;
    padding-top: 12px;
}

.sidebar-logout a {
    color: #f87171 !important;
}

/* Mobile top bar + hamburger */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1040;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    background: #1e1b4b;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.mobile-menu-btn {
    background: #312e81;
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-topbar-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-topbar-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
}

.mobile-topbar-user {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    width: 100%;
}

/* Cards & Tabs */
.card-custom {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.tab-content {
    display: none;
}

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

/* Form Styles */
.form-group-admin {
    margin-bottom: 20px;
}

.form-group-admin label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
}

.form-control-admin {
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #ffffff;
    box-sizing: border-box;
}

.form-control-admin:focus {
    border-color: #7b68ee;
    outline: none;
}

.btn-admin {
    background: #7b68ee;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-admin:hover {
    background: #6250d4;
}

/* Letter Preview Pane */
.document-preview-container {
    background: #f1f5f9;
    padding: 40px 20px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.letterhead-preview {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    min-height: 1000px;
    padding: 80px 60px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    font-family: 'Times New Roman', Times, serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
}

.letterhead-header {
    border-bottom: 3px double #1e1b4b;
    padding-bottom: 20px;
    margin-bottom: 40px;
    text-align: center;
}

.letterhead-header h1 {
    font-family: 'Poppins', sans-serif;
    color: #1e1b4b;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.letterhead-header p {
    font-family: 'Poppins', sans-serif;
    color: #475569;
    font-size: 12px;
    margin: 5px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.letterhead-footer {
    position: absolute;
    bottom: 60px;
    left: 60px;
    right: 60px;
    border-top: 1px solid #cbd5e1;
    padding-top: 15px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: #64748b;
}

/* Table Style */
.table-admin {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table-admin th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
}

.table-admin td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    color: #334155;
    vertical-align: top;
}

/* Alert Boxes */
.alert-admin {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
    font-size: 14px;
}

.alert-admin-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-admin-danger {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.alert-admin-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #b45309;
}

/* Print CSS */
@media print {
    body * {
        visibility: hidden;
    }
    .letterhead-preview, .letterhead-preview * {
        visibility: visible;
    }
    .letterhead-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        padding: 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .mobile-topbar {
        display: flex;
    }

    .admin-wrapper {
        flex-direction: column;
        min-height: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        height: 100dvh;
        width: min(300px, 88vw);
        min-width: 0;
        z-index: 1050;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-menu {
        flex-direction: column;
        gap: 4px;
    }

    .sidebar-menu a {
        padding: 12px 14px;
        font-size: 14px;
    }

    .main-content {
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .card-custom {
        padding: 18px 14px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .stat-value {
        font-size: 24px;
    }

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

    .table-admin th,
    .table-admin td {
        padding: 10px 8px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .document-preview-container {
        padding: 10px;
        margin-top: 15px;
        overflow-x: auto;
    }

    .letterhead-preview {
        padding: 30px 20px;
        min-height: auto;
        font-size: 13.5px;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .letterhead-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .letterhead-header h1 {
        font-size: 24px;
    }

    .letterhead-footer {
        position: static;
        margin-top: 40px;
        padding-top: 10px;
    }

    .login-card {
        padding: 28px 20px;
        margin: 16px;
        border-radius: 14px;
    }

    .perf-bar-wrap {
        flex-wrap: wrap;
    }

    .btn-admin {
        width: 100%;
    }

    .kanban-board {
        flex-direction: column;
        gap: 12px;
    }

    .kanban-col {
        min-height: auto;
        padding: 14px 12px;
    }
}

@media (max-width: 575.98px) {
    .mobile-topbar-title {
        font-size: 15px;
    }

    .card-custom h3 {
        font-size: 17px;
    }

    .row > [class*="col-"] {
        margin-bottom: 8px;
    }
}

/* Kanban Board Styling */
.kanban-board {
    display: flex;
    gap: 20px;
    margin-top: 25px;
}

.kanban-col {
    flex: 1;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 20px 15px;
    min-height: 550px;
    border: 1px solid #e2e8f0;
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #cbd5e1;
}

.kanban-col-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-col-count {
    background: #cbd5e1;
    color: #475569;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.kanban-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border-left: 4px solid #cbd5e1;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08);
}

.kanban-card.priority-high {
    border-left-color: #ef4444;
}

.kanban-card.priority-medium {
    border-left-color: #f59e0b;
}

.kanban-card.priority-low {
    border-left-color: #3b82f6;
}

.kanban-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.4;
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.kanban-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
}

.kanban-badge-category {
    background: #f1f5f9;
    color: #475569;
}

.kanban-badge-project {
    background: #e0e7ff;
    color: #4338ca;
}

.kanban-badge-assignee {
    background: #ecfdf5;
    color: #047857;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    margin-top: 10px;
}

.kanban-card-date {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.kanban-actions {
    display: flex;
    gap: 6px;
}

.kanban-btn {
    border: none;
    background: none;
    color: #64748b;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.kanban-btn:hover {
    background: #f1f5f9;
    color: #7b68ee;
}

/* Team performance dashboard */
.stat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-left: 4px solid #7b68ee;
    height: 100%;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #101834;
    margin: 8px 0 4px;
}

.stat-hint {
    font-size: 12px;
    color: #94a3b8;
}

.dept-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.dept-card-header {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dept-card-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.dept-card-body {
    padding: 14px 16px;
    font-size: 14px;
}

.dept-pill {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-online {
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
}

.status-online i {
    font-size: 8px;
}

.status-offline {
    color: #94a3b8;
    font-size: 12px;
}

.perf-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.perf-bar-wrap span {
    font-size: 12px;
    font-weight: 700;
    min-width: 36px;
}

.perf-bar {
    height: 8px;
    border-radius: 4px;
    flex: 1;
    max-width: 80px;
    background: #e2e8f0;
}

.team-table td {
    vertical-align: middle;
}

.sidebar-monitor-note {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    margin: 0 0 14px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    line-height: 1.4;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.screenshot-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.screenshot-thumb-wrap {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f1f5f9;
}

.screenshot-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    transition: transform 0.2s;
}

.screenshot-thumb-wrap:hover .screenshot-thumb {
    transform: scale(1.03);
}

.screenshot-meta {
    padding: 10px 12px;
    font-size: 11px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.screenshot-meta strong {
    color: #1e293b;
    font-size: 13px;
}

.access-list {
    font-size: 13px;
    color: #475569;
    padding-left: 18px;
    margin: 0;
    line-height: 1.7;
}

.access-allow li::marker {
    color: #10b981;
}

.access-deny li::marker {
    color: #ef4444;
}

@media (max-width: 991.98px) {
    .screenshot-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
}

.work-policy-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 13px;
    margin-bottom: 16px;
}

.compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.compliance-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.compliance-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.compliance-card-head strong {
    display: block;
    color: #1e293b;
    font-size: 15px;
}

.compliance-dept {
    font-size: 12px;
    color: #64748b;
}

.compliance-score {
    font-size: 18px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

.compliance-score.score-ok {
    background: #ecfdf5;
    color: #047857;
}

.compliance-score.score-warn {
    background: #fffbeb;
    color: #b45309;
}

.compliance-score.score-bad {
    background: #fef2f2;
    color: #b91c1c;
}

.compliance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.compliance-stats .label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.compliance-stats .value {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.compliance-stats .value.text-warn {
    color: #b45309;
}

.badge-online {
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 6px;
}

.badge-offline {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.compliance-flags {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    font-size: 12px;
}

.compliance-flags li {
    padding: 6px 0;
    border-top: 1px solid #f1f5f9;
}

.compliance-flags li i {
    margin-right: 6px;
}

.compliance-flags .flag-ok {
    color: #047857;
}

.compliance-flags .flag-warning {
    color: #b45309;
}

.compliance-flags .flag-danger {
    color: #b91c1c;
}

.compliance-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-compliance-link {
    font-size: 12px;
    font-weight: 600;
    color: #7b68ee;
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.btn-compliance-link:hover {
    background: #f1f5f9;
    color: #6d28d9;
    text-decoration: none;
}
