:root {
    --bg-app: #0F172A;
    /* Slate 900 */
    --bg-panel: rgba(30, 41, 59, 0.7);
    /* Slate 800 */
    --bg-input: rgba(15, 23, 42, 0.8);
    --bg-darker: #0B1120;

    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;

    --primary: #EC4899;
    /* Pink 500 */
    --primary-hover: #F472B6;
    /* Pink 400 */
    --primary-10: rgba(236, 72, 153, 0.1);

    --accent: #FBCFE8;
    /* Pink 200 */
    --danger: #EF4444;

    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Utils */
.hidden {
    display: none !important;
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex {
    display: flex;
}

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

.items-center {
    align-items: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-center {
    justify-content: center;
}

.flex-1 {
    flex: 1;
}

.flex-fill {
    flex-grow: 1;
}

.full-width {
    width: 100%;
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-auto {
    margin-left: auto;
}

.p-0 {
    padding: 0;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-5 {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.pt-0 {
    padding-top: 0;
}

.pt-4 {
    padding-top: 1rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.row {
    display: flex;
    gap: 1rem;
}

.col {
    flex: 1;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-md {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-mono {
    font-family: var(--font-mono);
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.05em;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-dark {
    background: var(--bg-app);
}

.bg-darker {
    background: var(--bg-darker);
}

.border-right {
    border-right: 1px solid var(--border);
}

.border-bottom {
    border-bottom: 1px solid var(--border);
}

.border-top {
    border-top: 1px solid var(--border);
}

.border-dashed {
    border: 2px dashed var(--border);
}

.border-primary {
    border-color: var(--primary) !important;
}

.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.rounded-b {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.rounded-lg {
    border-radius: 16px;
}

.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.top-4 {
    top: 1rem;
}

.right-4 {
    right: 1rem;
}

/* Custom Base */
.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.inp {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-sans);
}

.inp:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

.inp.sm {
    padding: 0.5rem 0.7rem;
    font-size: 0.875rem;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='14' height='14' stroke='%2394A3B8' stroke-width='2' fill='none'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    transition: all 0.2s;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.outline {
    background: transparent;
}

.btn.danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn.ghost {
    background: transparent;
    border-color: transparent;
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn.sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Layout Elements */
.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    z-index: 5;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
}

.brand h1 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand-icon {
    background: var(--primary);
    color: white;
    display: flex;
    padding: 0.4rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-btn.active {
    background: var(--primary-10);
    color: var(--primary);
    font-weight: 600;
}

.workspace {
    flex-grow: 1;
    background: var(--bg-app);
}

.scroll-y {
    overflow-y: auto;
}

/* Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    padding: 1.5rem;
    position: relative;
}

.card.interactive {
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card.interactive:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(236, 72, 153, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    transition: opacity 0.3s;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 101;
    transition: opacity 0.3s, transform 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -45%) scale(0.95);
    display: flex !important;
    /* overridden by JS visibility later if needed, but transition requires layout */
}

.modal.w-lg {
    max-width: 700px;
}

form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-10);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-pane {
    display: none;
}

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

/* Service Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-app);
    border: 2px solid var(--primary);
    z-index: 2;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        width: 100%;
        padding-bottom: 0;
    }

    .search-wrap {
        width: 100%;
    }

    .category-nav {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        white-space: nowrap;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-title {
        display: none;
    }

    .sidebar>.p-4 {
        display: none;
    }

    /* hide sidebar Add btn on mobile, add a FAB instead */
}