/* SugarCode Design Language (SCDL)
   Phase 5: Sugar-Sharp Minimalism
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Palette */
    --obsidian-dark: #121213;
    --obsidian: #1A1A1B;
    --obsidian-light: #252526;

    --cyan: #00E5FF;
    --cyan-dim: rgba(0, 229, 255, 0.1);

    --mint: #00FF9D;
    --mint-dim: rgba(0, 255, 157, 0.1);

    --crimson: #FF4444;
}

/* Global Layout Grid (Desktop) */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    background: #111;
    overflow-y: auto;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    /* Pushes footer down */
    padding: 30px;
    padding-bottom: 60px;
}

/* Sidebar Bottom Spacing */
.nav-bottom {
    padding: 20px;
    padding-bottom: 40px;
    /* Lift off the bottom edge */
    border-top: 1px solid #333;
    background: #151515;
}

/* Reset & Base */
body {
    background-color: var(--obsidian);
    --white: #F8F9FA;
    --gray-500: #888888;

    /* Spacing */
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;

    /* UI */
    --radius: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --border: 1px solid #333;
}

/* Reset & Base */
body {
    background-color: var(--obsidian);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-top: 0;
}

h1 {
    font-size: 2rem;
    color: var(--white);
}

h2 {
    font-size: 1.5rem;
    color: var(--cyan);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--cyan);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-md {
    gap: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

/* Components: Card */
.card {
    background: var(--obsidian-light);
    border: var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #444;
}

/* Components: Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--cyan);
    color: #000;
}

.btn-primary:hover {
    background: #33ffff;
    box-shadow: 0 0 15px var(--cyan-dim);
}

.btn-secondary {
    background: var(--obsidian-dark);
    color: var(--white);
    border: 1px solid #444;
}

.btn-secondary:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.btn-danger {
    background: rgba(255, 68, 68, 0.1);
    color: var(--crimson);
    border: 1px solid var(--crimson);
}

/* Components: Inputs */
input,
select,
textarea {
    background: var(--obsidian-dark);
    border: var(--border);
    color: var(--white);
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--cyan);
}

/* The Cockpit: Gauge */
.gauge-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: #333;
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    /* Stroke color is handled inline or via class modifier */
    transition: stroke-dasharray 0.6s ease 0s;
}

.percentage {
    fill: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    font-size: 0.5em;
    text-anchor: middle;
}

/* Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
}

.badge-success {
    background: var(--mint-dim);
    color: var(--mint);
    border: 1px solid var(--mint);
}

.badge-warning {
    background: rgba(255, 200, 0, 0.1);
    color: #ffcc00;
    border: 1px solid #ffcc00;
}

.badge-danger {
    background: rgba(255, 68, 68, 0.1);
    color: var(--crimson);
    border: 1px solid var(--crimson);
}

/* Navigation: Sidebar (Glassmorphism) */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(18, 18, 19, 0.95);
    border-right: 1px solid #333;
    backdrop-filter: blur(10px);
}

.brand-block {
    padding: 20px 20px 20px 28px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
    background: linear-gradient(180deg, #252526 0%, #1A1A1B 100%);
}

.nav-items {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-item:hover i {
    transform: translateX(3px);
    color: var(--cyan);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.05) 0%, transparent 100%);
    border-left-color: var(--cyan);
}

.nav-item.active i {
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-dim);
}

.nav-divider {
    height: 1px;
    background: #333;
    margin: 10px 20px;
}

.nav-bottom {
    padding: 20px;
    border-top: 1px solid #333;
    background: #151515;
}

/* Navbar: Top (Client / Command Bar) */
.navbar-top {
    background: rgba(26, 26, 27, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    height: 35px;
}

.top-links {
    display: flex;
    gap: 30px;
}

.top-link {
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    padding: 24px 0;
}

.top-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--cyan);
    transition: width 0.3s;
}

.top-link:hover,
.top-link.active {
    color: #fff;
}

.top-link:hover::after,
.top-link.active::after {
    width: 100%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: #aaa;
    background: #111;
    padding: 5px 15px;
    border-radius: 50px;
    border: 1px solid #333;
}

/* Tables - Enhanced */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    letter-spacing: 1px;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid #222;
    font-size: 0.9rem;
    color: #ddd;
    background: rgba(255, 255, 255, 0.01);
    transition: background 0.2s;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Dashboard Specifics */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(145deg, #202021, #161617);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
    border-color: var(--cyan);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 229, 255, 0.1);
}

.stat-icon {
    font-size: 2rem;
    color: #444;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.stat-card:hover .stat-icon {
    color: var(--cyan);
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 5px 0;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Service Cards */
.service-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--mint);
}

.service-icon-box {
    width: 50px;
    height: 50px;
    background: #111;
    border-radius: 10px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--mint);
}

.service-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.service-info span {
    font-size: 0.85rem;
    color: #888;
}

.progress-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--mint);
    transition: width 0.5s ease;
}
/* Footer Global */
.footer {
    border-top: 1px solid #222;
    padding: 15px 0;
    background: #1a1a1a;
    color: #666;
    font-size: 0.75rem;
    text-align: center;
    margin-top: auto;
    width: 100%;
    z-index: 10;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--cyan);
}

