/* ============================================
   DataVault - Global Styles (Black & White Theme)
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111111;
    background-color: #f5f5f5;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #111111;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #555555;
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: #000000;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* Layout - App Shell */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #0a0a0a;
    color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid #222222;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: #ffffff;
    color: #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-brand .brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666666;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #cccccc;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.2s;
    gap: 12px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: #1a1a1a;
    color: #ffffff;
}

.nav-item.active {
    background-color: #1a1a1a;
    color: #ffffff;
    border-left-color: #ffffff;
    font-weight: 500;
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #222222;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #ffffff;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-plan {
    font-size: 0.7rem;
    color: #888888;
    text-transform: capitalize;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    color: #333333;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: 8px 16px 8px 36px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #f9f9f9;
    transition: all 0.2s;
}

.header-search input:focus {
    outline: none;
    border-color: #000000;
    background: #ffffff;
}

.header-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
    font-size: 0.85rem;
}

.header-btn {
    background: none;
    border: 1px solid #e0e0e0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #555555;
    font-size: 1rem;
}

.header-btn:hover {
    border-color: #000000;
    color: #000000;
}

/* Page Content */
.page-content {
    padding: 32px;
    flex: 1;
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: #000000;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #777777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 0.8rem;
    color: #888888;
}

.stat-change.positive {
    color: #2d8a2d;
}

.stat-change.negative {
    color: #cc3333;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777777;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

table tbody td {
    padding: 12px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333333;
}

table tbody tr:hover {
    background-color: #fafafa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-primary:hover {
    background: #1a1a1a;
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: #111111;
    border-color: #d0d0d0;
}

.btn-secondary:hover {
    border-color: #000000;
    color: #000000;
}

.btn-danger {
    background: #ffffff;
    color: #cc3333;
    border-color: #cc3333;
}

.btn-danger:hover {
    background: #cc3333;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333333;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #ffffff;
    transition: border-color 0.2s;
    color: #111111;
}

.form-control:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.form-control::placeholder {
    color: #aaaaaa;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.75rem;
    color: #999999;
    margin-top: 4px;
}

.form-error {
    font-size: 0.8rem;
    color: #cc3333;
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-dark {
    background: #000000;
    color: #ffffff;
}

.badge-light {
    background: #f0f0f0;
    color: #555555;
}

.badge-success {
    background: #e8f5e9;
    color: #2d8a2d;
}

.badge-warning {
    background: #fff8e1;
    color: #b8860b;
}

.badge-danger {
    background: #fce4ec;
    color: #cc3333;
}

/* Quality Score */
.quality-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.quality-bar {
    width: 60px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.quality-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.quality-high .quality-bar-fill { background: #2d8a2d; }
.quality-medium .quality-bar-fill { background: #b8860b; }
.quality-low .quality-bar-fill { background: #cc3333; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    list-style: none;
}

.pagination li {
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #555555;
    transition: all 0.2s;
    text-decoration: none;
}

.pagination a:hover {
    border-color: #000000;
    color: #000000;
}

.pagination .active span {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.pagination .disabled span {
    color: #cccccc;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #f0f9f0;
    color: #2d8a2d;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #fdf0f0;
    color: #cc3333;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fffbf0;
    color: #b8860b;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #f0f4f8;
    color: #555555;
    border: 1px solid #d0d0d0;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filters-bar .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.filters-bar select.form-control {
    width: auto;
    min-width: 150px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999999;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    color: #555555;
    margin-bottom: 8px;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 20px;
    font-size: 0.9rem;
}

/* Detail Page */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.detail-field {
    margin-bottom: 16px;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888888;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.95rem;
    color: #111111;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #888888; }
.text-sm { font-size: 0.8rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Action Buttons Group */
.action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .header-search input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .hamburger-btn {
        display: block;
    }

    .top-header {
        padding: 0 16px;
    }

    .page-content {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar .search-input {
        max-width: 100%;
    }

    .header-search {
        display: none;
    }

    table {
        font-size: 0.8rem;
    }

    table thead th,
    table tbody td {
        padding: 8px 10px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 0.95rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
}
