/* ======================================
   ISP SaaS - Professional Admin UI v2
====================================== */

/* ---------- ROOT VARIABLES ---------- */
:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #f4f6f9;
    --dark: #2d3436;
    --text: #333;
    --border: #e5e7eb;
    --radius: 8px;
}

/* ---------- GLOBAL RESET ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--text);
    font-size: 14px;
}

/* ---------- LAYOUT ---------- */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: 240px;
    background: var(--primary);
    color: #fff;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: 600;
}

.sidebar a {
    display: block;
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: 0.2s;
}

.sidebar a:hover {
    background: var(--secondary);
}

.sidebar a.active {
    background: rgba(255,255,255,0.15);
}

/* ---------- MAIN CONTENT ---------- */
.main {
    margin-left: 240px;
    flex: 1;
    padding: 20px 30px;
}

/* ---------- TOPBAR ---------- */
.topbar {
    background: #fff;
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ---------- CARDS ---------- */
.card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* ---------- DASHBOARD STATS ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 20px;
}

.stat-box {
    background: var(--primary);
    color: #fff;
    padding: 20px;
    border-radius: var(--radius);
    transition: 0.2s;
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-box h4 {
    font-size: 13px;
    opacity: 0.8;
}

.stat-box p {
    font-size: 24px;
    font-weight: 600;
}

/* ---------- FORMS ---------- */
form {
    margin-bottom: 20px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-block;
    padding: 9px 14px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }

.btn:hover {
    opacity: 0.9;
}

/* ---------- TABLE ---------- */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 800px;
}

table th {
    background: var(--secondary);
    color: #fff;
    padding: 12px;
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table tr:hover {
    background: #f8f9fa;
}

/* ---------- ALERTS ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-danger  { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }

/* ---------- LOGIN PAGE ---------- */
.login-container {
    width: 380px;
    margin: 120px auto;
    background: #fff;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ---------- RESPONSIVE ---------- */
@media(max-width: 992px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main {
        margin-left: 0;
    }
}

@media(max-width: 768px) {
    .stats {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 600px;
    }
}