@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@400;500;700&display=swap');

:root {
    --background: #0A0A0A;
    --surface: #121212;
    --surface-highlight: #1E1E20;
    --border-color: #27272A;
    --primary: #6366F1;
    --primary-hover: #5558E3;
    --primary-foreground: #FFFFFF;
    --text-main: #EDEDED;
    --text-muted: #A1A1AA;
    --text-placeholder: #52525B;
    --urgency-low: #10B981;
    --urgency-medium: #F59E0B;
    --urgency-high: #EF4444;
}

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

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 448px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
}

.logo svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.logo span {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

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

.user-name {
    font-size: 14px;
    color: var(--text-muted);
}

.user-name strong {
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 0 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 25px -5px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: var(--surface-highlight);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: var(--surface-highlight);
    color: var(--text-main);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--urgency-high);
}

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

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    border-radius: 6px;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s;
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

/* Inputs */
.input {
    width: 100%;
    background: var(--background);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.input::placeholder {
    color: var(--text-placeholder);
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.input-group {
    position: relative;
}

.input-group .input {
    padding-right: 48px;
}

.input-group .btn-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.input-group .btn-icon:hover {
    color: var(--text-main);
}

.input-with-icon {
    padding-left: 48px;
}

.input-icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

textarea.input {
    resize: vertical;
    min-height: 80px;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--urgency-low);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--urgency-medium);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--urgency-high);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot-green {
    background: var(--urgency-low);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot-orange {
    background: var(--urgency-medium);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-dot-red {
    background: var(--urgency-high);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Urgency bar */
.urgency-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 8px 0 0 8px;
}

.urgency-bar-low { background: var(--urgency-low); }
.urgency-bar-medium { background: var(--urgency-medium); }
.urgency-bar-high { background: var(--urgency-high); }

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    padding: 12px;
    border-radius: 8px;
}

.stat-icon-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.stat-icon-orange { background: rgba(245, 158, 11, 0.1); color: var(--urgency-medium); }
.stat-icon-green { background: rgba(16, 185, 129, 0.1); color: var(--urgency-low); }

.stat-value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* Filters */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

/* Projects grid */
.projects-section {
    margin-bottom: 40px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Project card */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card-content {
    padding-left: 16px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.project-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    transition: color 0.2s;
}

.project-card:hover .project-name {
    color: var(--primary);
}

.project-client {
    font-size: 14px;
    color: var(--text-muted);
}

.project-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.project-tag {
    font-size: 12px;
    padding: 4px 8px;
    background: var(--surface-highlight);
    border-radius: 4px;
    color: var(--text-muted);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.project-meta svg {
    width: 14px;
    height: 14px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-color: var(--urgency-low);
}

.toast-error {
    border-color: var(--urgency-high);
}

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

/* Auth pages */
.auth-container {
    min-height: 100vh;
    display: flex;
}

.auth-left {
    flex: 1;
    display: none;
    position: relative;
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    padding: 48px;
}

@media (min-width: 1024px) {
    .auth-left {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1760978632061-ad00f48789ae?w=1200') center/cover;
    opacity: 0.3;
}

.auth-left-content {
    position: relative;
    z-index: 1;
}

.auth-left h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.auth-left p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 400px;
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-form {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-form .subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Two column layout for project detail */
.project-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .project-detail-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Credentials list */
.credentials-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.credential-card {
    position: relative;
}

.credential-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.credential-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.credential-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.credential-card:hover .credential-actions {
    opacity: 1;
}

.credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.credential-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.credential-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.credential-field svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.credential-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.credential-password {
    filter: blur(4px);
    user-select: none;
}

.credential-password.visible {
    filter: none;
    user-select: auto;
}

/* URL display */
.url-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--background);
    border-radius: 6px;
    margin-bottom: 12px;
}

.url-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.url-type {
    font-size: 12px;
    color: var(--text-muted);
}

.url-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

.url-link:hover {
    text-decoration: underline;
}

/* Invitation codes */
.invitation-code-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.code-icon {
    padding: 8px;
    border-radius: 8px;
}

.code-icon-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--urgency-low);
}

.code-icon-used {
    background: var(--surface-highlight);
    color: var(--text-muted);
}

.code-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    letter-spacing: 0.05em;
}

.code-used {
    text-decoration: line-through;
    color: var(--text-muted);
}

.code-note {
    font-size: 14px;
    color: var(--text-muted);
}

.code-date {
    font-size: 12px;
    color: var(--text-placeholder);
    margin-top: 4px;
}

/* Grid utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.hidden { display: none !important; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* Loading spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px;
}
