/* ==========================================================================
   AUDIO VAULT - Studio Dark Theme Design System
   ========================================================================== */

:root {
    --bg-dark: #090d16;
    --bg-canvas: #0c1220;
    --card-bg: rgba(18, 26, 43, 0.72);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(0, 242, 254, 0.3);
    
    --primary: #00f2fe;
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --primary-glow: rgba(0, 242, 254, 0.25);
    
    --purple: #a855f7;
    --purple-gradient: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
    
    --green: #10b981;
    --green-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
    
    --amber: #f59e0b;
    --red: #ef4444;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --input-bg: rgba(15, 23, 42, 0.8);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus: #00f2fe;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.18);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.04) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Helpers */
.hidden { display: none !important; }
.text-bold { font-weight: 600; }
.text-green { color: var(--green); font-weight: 600; }
.text-danger { color: var(--red); }
.text-right { text-align: right; }
.margin-top { margin-top: 1.25rem; }

/* Alert */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}
.btn-primary {
    background: var(--primary-gradient);
    color: #040914;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}
.btn-success {
    background: var(--green-gradient);
    color: #ffffff;
    font-weight: 600;
}
.btn-success:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}
.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}
.btn-danger-ghost {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.2);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-block { width: 100%; }
.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s;
}
.btn-icon:hover { color: var(--text-main); }

/* Forms */
.form-group {
    margin-bottom: 1.1rem;
}
.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.form-group label.required::after {
    content: "*";
    color: var(--red);
    margin-left: 2px;
}
.form-group label i {
    color: var(--primary);
    font-size: 0.85rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}
textarea { resize: vertical; }

.form-row {
    display: flex;
    gap: 1rem;
}
.col-6 { flex: 1; }
.col-4 { flex: 1; }

/* Auth Screen */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-card);
}
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.brand-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #040914;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-glow);
}
.auth-brand h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 1px;
    font-weight: 700;
}
.auth-brand p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 1.5rem;
}
.auth-tab {
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.auth-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}
.auth-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-dim);
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
}

/* Dashboard Layout */
.dashboard-wrapper {
    max-width: 1360px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Header Nav */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #040914;
    font-size: 1.25rem;
}
.nav-title h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    line-height: 1.2;
}
.nav-title span {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--card-border);
    font-size: 0.85rem;
    color: var(--primary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--card-hover-border);
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.icon-cyan { background: rgba(0, 242, 254, 0.12); color: var(--primary); }
.icon-purple { background: rgba(168, 85, 247, 0.12); color: var(--purple); }
.icon-green { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.icon-amber { background: rgba(245, 158, 11, 0.12); color: var(--amber); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-info h3 { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; }

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.search-box {
    position: relative;
    width: 320px;
}
.search-box i.fa-magnifying-glass {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.9rem;
}
.search-box input {
    padding-left: 2.5rem;
    padding-right: 2rem;
}
.search-box .btn-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}
.filter-box select {
    min-width: 140px;
}
.view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.btn-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
}
.btn-toggle.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--primary);
}

/* Data Table */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    box-shadow: var(--shadow-card);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}
.data-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}
.data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* Tags & Badges */
.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}
.tag-daw { background: rgba(0, 242, 254, 0.1); color: var(--primary); border: 1px solid rgba(0, 242, 254, 0.2); }
.tag-soundcard { background: rgba(168, 85, 247, 0.1); color: var(--purple); border: 1px solid rgba(168, 85, 247, 0.2); }
.tag-mic { background: rgba(245, 158, 11, 0.1); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.tag-cpu { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); border: 1px solid var(--card-border); }

/* Card Grid View */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.preset-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
}
.preset-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-hover-border);
}
.preset-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.preset-customer h4 {
    font-size: 1.05rem;
    font-weight: 600;
}
.preset-customer span {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.preset-price {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--green);
}
.preset-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.preset-card-notes {
    font-size: 0.82rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.preset-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
    margin-top: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
}
.empty-icon {
    font-size: 3rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.empty-state h3 { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.85rem; color: var(--text-dim); }

/* File Dropzone */
.file-dropzone {
    border: 2px dashed var(--input-border);
    border-radius: var(--radius-sm);
    padding: 1.75rem 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}
.file-dropzone:hover, .file-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(0, 242, 254, 0.05);
}
.dropzone-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.dropzone-text { font-size: 0.9rem; font-weight: 500; }
.dropzone-sub { font-size: 0.75rem; color: var(--text-dim); }

.file-info-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.2);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
}
.file-icon { font-size: 1.5rem; color: var(--primary); }
.file-details { flex: 1; display: flex; flex-direction: column; }
.file-name { font-weight: 500; font-size: 0.88rem; }
.file-size { font-size: 0.75rem; color: var(--text-muted); }

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 9, 20, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}
.modal-card {
    background: #0f172a;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-card);
    padding: 1.75rem;
}
.modal-lg { max-width: 760px; }
.modal-sm { max-width: 420px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 1.25rem;
}
.modal-header h3 {
    font-size: 1.15rem;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}
.modal-header h3 i { color: var(--primary); }
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.modal-close:hover { color: var(--text-main); }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

/* Detail View Layout */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.detail-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
}
.detail-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}
.detail-label i { color: var(--primary); }
.detail-value { font-size: 0.95rem; }
.notes-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.file-download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.2);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
}
.file-download-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.icon-lg { font-size: 2rem; color: var(--primary); }

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: #0f172a;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    color: var(--text-main);
    font-size: 0.88rem;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-success { border-left: 4px solid var(--green); }
.toast-error { border-left: 4px solid var(--red); }
.toast-info { border-left: 4px solid var(--primary); }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-wrapper { padding: 1rem; }
    .form-row { flex-direction: column; gap: 0; }
    .search-box { width: 100%; }
    .toolbar-left, .toolbar-right { width: 100%; justify-content: space-between; }
    .detail-grid { grid-template-columns: 1fr; }
    .file-download-card { flex-direction: column; align-items: stretch; gap: 1rem; text-align: center; }
    .file-download-info { justify-content: center; }
}
