/* ============================================================
   INDUSTRIAL DARK UI SYSTEM - generic-theme.css
   Industrial, flat dark theme for generic dashboards and admin tools.
   Import: <link rel="stylesheet" href="netzdrive.css">
   ============================================================ */

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

/* ============================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */
:root {
    /* Backgrounds */
    --bg-body: #d7d7d7;
    --bg-sidebar: #333333;
    --bg-card: #333333;
    --bg-hover: #444444;
    --bg-active: #555555;
    --bg-input: #ffffff;
    --bg-log: #000000;

    /* Text */
    --text-primary: #eeeeee;
    --text-secondary: #bbbbbb;
    --text-accent: #a6c9e5;
    --text-success: #69f0ae;
    --text-warning: #ffd740;
    --text-danger: #f85149;
    --text-input: #333333;
    --text-muted: #8b949e;
    --text-log: #cccccc;
    --text-placeholder: #999999;

    /* Status */
    --status-ok: #3fb950;
    --status-error: #f85149;
    --status-warning: #d29922;
    --status-info: #58a6ff;
    --status-purple: #6e40c9;

    /* Gradients */
    --gradient-success: linear-gradient(135deg, #238636, #2ea043);
    --gradient-purple: linear-gradient(135deg, #6e40c9, #8b5cf6);

    /* Borders */
    --border: 1px solid #444444;
    --border-light: 1px solid #555555;
    --border-input: 1px solid #cccccc;

    /* Fonts */
    --font-mono: 'Fira Code', monospace;
    --font-sans: 'Inter', sans-serif;

    /* Spacing */
    --space-unit: 20px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 10px;
    --space-4: 12px;
    --space-5: 15px;
    --space-6: 16px;
    --space-7: 20px;
    --space-8: 40px;

    /* Font sizes */
    --text-2xs: 0.55rem;
    --text-xs: 0.6rem;
    --text-sm: 0.75rem;
    --text-base: 0.8rem;
    --text-md: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.1rem;
    --text-2xl: 1.2rem;
    --text-3xl: 1.3rem;
}

/* ============================================================
   2. GLOBAL RESET & BASE
   ============================================================ */
* {
    box-sizing: border-box;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* ============================================================
   3. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-sidebar);
}
::-webkit-scrollbar-thumb {
    background: #555;
}
::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */
::placeholder {
    color: var(--text-placeholder);
}

/* ============================================================
   5. LAYOUT
   ============================================================ */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    color: var(--text-primary);
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-body);
}

.content-scroll {
    padding: var(--space-unit);
    overflow-y: auto;
    height: calc(100vh - 60px);
}

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

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

/* ============================================================
   6. TOP BAR
   ============================================================ */
.top-bar {
    height: 60px;
    border-bottom: var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--space-unit);
    justify-content: space-between;
    background: var(--bg-sidebar);
    color: var(--text-primary);
}

.breadcrumb {
    font-family: var(--font-mono);
    font-size: var(--text-md);
    color: var(--text-secondary);
}
.breadcrumb strong {
    color: var(--text-primary);
}

/* ============================================================
   7. BRAND
   ============================================================ */
.brand {
    padding: 15px var(--space-unit);
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: 1px;
    border-bottom: var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ============================================================
   8. NAVIGATION
   ============================================================ */
.nav-section {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.nav-header {
    padding: 10px 20px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    font-size: var(--text-md);
    border-left: 3px solid transparent;
    transition: background 0.1s;
}
.nav-item:hover {
    background: var(--bg-hover);
}
.nav-item.active {
    background: var(--bg-active);
    border-left-color: var(--text-accent);
}
.nav-item .meta {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.user-profile {
    padding: var(--space-unit);
    border-top: var(--border);
    background: var(--bg-sidebar);
}

/* ============================================================
   9. CARDS
   ============================================================ */
.card {
    border: var(--border);
    background: var(--bg-card);
    margin-bottom: 20px;
    padding: 20px;
    color: var(--text-primary);
}
.card h2 {
    margin-top: 0;
    font-size: var(--text-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: var(--border);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

/* ============================================================
   10. BUTTONS
   ============================================================ */
.btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: var(--text-base);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-primary);
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    border-color: var(--text-accent);
    color: var(--text-accent);
}
.btn-primary:hover {
    background: var(--text-accent);
    color: #000;
}

.btn-danger {
    border-color: var(--status-error);
    color: var(--status-error);
}
.btn-danger:hover {
    background: var(--status-error);
    color: #fff;
}

.btn-warning {
    border-color: var(--status-warning);
    color: var(--status-warning);
}
.btn-warning:hover {
    background: var(--status-warning);
    color: #000;
}

.btn-success {
    border-color: #2ea043;
    color: #fff;
    background: var(--gradient-success);
    font-weight: 700;
}
.btn-success:hover {
    filter: brightness(1.15);
}

.btn-accent {
    border-color: var(--status-purple);
    color: #fff;
    background: var(--status-purple);
}
.btn-accent:hover {
    filter: brightness(1.2);
}

.btn-sm {
    padding: 4px 10px;
    font-size: var(--text-sm);
}

/* ============================================================
   11. FORM INPUTS
   ============================================================ */
input, select {
    background: var(--bg-input);
    border: var(--border-input);
    color: var(--text-input);
    padding: 10px;
    width: 100%;
    font-family: var(--font-mono);
    font-size: var(--text-md);
    margin-bottom: 10px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--text-accent);
}

/* ============================================================
   12. TABLES
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
th {
    text-align: left;
    padding: 10px;
    border-bottom: var(--border);
    color: var(--text-secondary);
    font-size: var(--text-base);
    text-transform: uppercase;
    font-weight: normal;
}
td {
    padding: 12px 10px;
    border-bottom: var(--border);
    font-size: var(--text-md);
    color: var(--text-primary);
}
tr:hover td {
    background: var(--bg-hover);
}

/* ============================================================
   13. BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid transparent;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    font-family: var(--font-mono);
}
.badge-active {
    border-color: var(--text-success);
    color: var(--text-success);
}
.badge-pending {
    border-color: var(--text-warning);
    color: var(--text-warning);
}
.badge-inactive {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.beta-badge {
    background: #ff9800;
    color: #000;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 2px !important;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    font-family: var(--font-mono);
}
.testing-badge {
    background: #9c27b0;
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 2px !important;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* ============================================================
   14. LOG PANEL
   ============================================================ */
.log-panel {
    background: var(--bg-log);
    border: var(--border);
    color: var(--text-log);
    font-family: var(--font-mono);
    font-size: var(--text-base);
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    width: 100%;
    max-width: 100%;
}
.log-line {
    display: block;
}
.log-line-manager {
    color: var(--text-log);
}
.log-line-agent {
    color: var(--text-accent);
}

/* ============================================================
   15. MARKDOWN CONTENT
   ============================================================ */
.markdown-content {
    line-height: 1.6;
    color: var(--text-primary);
}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    color: var(--text-accent);
    border-bottom: 1px solid var(--bg-hover);
    padding-bottom: 5px;
    margin-top: 25px;
}
.markdown-content code {
    background: #000;
    padding: 2px 5px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}
.markdown-content pre {
    background: #000;
    padding: 15px;
    overflow-x: auto;
    border: 1px solid var(--bg-hover);
}
.markdown-content pre code {
    background: transparent;
    padding: 0;
}
.markdown-content a {
    color: var(--text-accent);
    text-decoration: none;
}
.markdown-content a:hover {
    text-decoration: underline;
}
.markdown-content blockquote {
    border-left: 4px solid var(--text-accent);
    margin: 0;
    padding-left: 15px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================================
   16. AUTH SCREEN
   ============================================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--bg-body);
    z-index: 1000;
}
.auth-box {
    width: 350px;
    text-align: center;
    border: var(--border);
    padding: 40px;
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ============================================================
   17. SPINNER
   ============================================================ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.spinner {
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid var(--text-accent);
    border-radius: 50% !important;
    width: 14px;
    height: 14px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

/* ============================================================
   18. UTILITIES
   ============================================================ */
.hidden {
    display: none !important;
}
.text-accent {
    color: var(--text-accent);
}
.text-success {
    color: var(--text-success);
}
.text-warning {
    color: var(--text-warning);
}
.text-danger {
    color: var(--text-danger);
}
.text-muted {
    color: var(--text-muted);
}
.text-mono {
    font-family: var(--font-mono);
}
.text-upper {
    text-transform: uppercase;
}
.font-bold {
    font-weight: 700;
}
