/* =====================================================
   3NET Domain Manager — Main Stylesheet
   Primary brand color: #F47920 (orange)
===================================================== */

:root {
    --orange:       #F47920;
    --orange-dark:  #d4661a;
    --orange-light: #fff3e8;
    --sidebar-bg:   #1a2332;
    --sidebar-hover:#243044;
    --sidebar-active:#2d3d56;
    --text-dark:    #1a2332;
    --text-muted:   #6c757d;
    --bg-light:     #f4f6f9;
    --white:        #ffffff;
    --border:       #e2e8f0;
    --success:      #28a745;
    --danger:       #dc3545;
    --warning:      #ffc107;
    --info:         #17a2b8;
    --radius:       8px;
    --shadow:       0 2px 12px rgba(0,0,0,0.08);
    --shadow-md:    0 4px 20px rgba(0,0,0,0.12);
    --sidebar-w:    250px;
    --topbar-h:     60px;
    --transition:   0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.5;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

/* =====================================================
   LAYOUT
===================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.logo-img {
    max-height: 38px;
    max-width: 160px;
    object-fit: contain;
    /*filter: brightness(0) invert(1);*/
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.65);
    transition: background var(--transition), color var(--transition);
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--white);
    border-left-color: var(--orange);
}

.nav-separator {
    padding: 14px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 6px;
}

.nav-icon { display: flex; align-items: center; flex-shrink: 0; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--orange);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
}

.user-details { min-width: 0; }
.user-name { color: white; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,0.45); font-size: 11px; }

.logout-btn {
    color: rgba(255,255,255,0.45);
    display: flex; align-items: center;
    padding: 6px;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    flex-shrink: 0;
}
.logout-btn:hover { color: var(--danger); background: rgba(220,53,69,0.1); }
.logout-btn svg { fill: currentColor; }

/* =====================================================
   MAIN CONTENT
===================================================== */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =====================================================
   TOPBAR
===================================================== */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.admin-badge {
    background: var(--orange);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.sidebar-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text-dark); border-radius: 2px;
    transition: var(--transition);
}

/* =====================================================
   PAGE CONTENT
===================================================== */
.page-content {
    padding: 24px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

/* =====================================================
   CARDS
===================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h2, .card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-body { padding: 20px; }

/* =====================================================
   STATS CARDS (Dashboard)
===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-icon.green  { background: #e8f5e9; color: #28a745; }
.stat-icon.red    { background: #fdecea; color: #dc3545; }
.stat-icon.blue   { background: #e3f2fd; color: #1976d2; }
.stat-icon svg { fill: currentColor; }

.stat-info { min-width: 0; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-dark); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* =====================================================
   TABLES
===================================================== */
.table-responsive { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    background: var(--bg-light);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

tbody td {
    padding: 12px 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.domain-name { font-weight: 600; color: var(--text-dark); font-size: 14px; }
.domain-tld  { color: var(--orange); }

/* =====================================================
   BADGES
===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-active    { background: #e8f5e9; color: #1e7e34; }
.badge-expired   { background: #fdecea; color: #c62828; }
.badge-pending   { background: #fff8e1; color: #e65100; }
.badge-info      { background: #e3f2fd; color: #0d47a1; }
.badge-cancelled { background: #f5f5f5; color: #616161; }
.badge-onhold    { background: #f3e5f5; color: #7b1fa2; }

/* =====================================================
   BUTTONS
===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--transition), transform var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--orange); color: white; }
.btn-primary:hover { background: var(--orange-dark); color: white; }

.btn-secondary { background: var(--bg-light); color: var(--text-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-dark); }

.btn-success   { background: var(--success); color: white; }
.btn-success:hover { background: #218838; color: white; }

.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover { background: #c82333; color: white; }

.btn-info      { background: var(--info); color: white; }
.btn-info:hover { background: #138496; color: white; }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }

.btn-icon { padding: 7px; border-radius: 6px; }
.btn-icon svg { fill: currentColor; display: block; }

/* =====================================================
   FORMS
===================================================== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

label { font-size: 13px; font-weight: 600; color: var(--text-dark); }
label .required { color: var(--danger); margin-left: 2px; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="tel"], input[type="number"], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(244,121,32,0.12);
}

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

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

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.form-check input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--orange);
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 8px;
}

/* =====================================================
   ALERTS
===================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.alert-success { background: #e8f5e9; color: #1b5e20; border-left: 4px solid #28a745; }
.alert-danger  { background: #fdecea; color: #b71c1c; border-left: 4px solid #dc3545; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border-left: 4px solid #1976d2; }
.alert-warning { background: #fff8e1; color: #e65100; border-left: 4px solid #ffc107; }

.alert-close {
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: inherit; opacity: 0.6; padding: 0 4px; line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* =====================================================
   DOMAIN EXPIRY COLORS
===================================================== */
.text-orange { color: var(--orange); }
.text-danger { color: var(--danger); }
.text-warning { color: #e65100; }
.text-success { color: var(--success); }
.text-muted   { color: var(--text-muted); }

/* =====================================================
   ACTION BUTTONS IN TABLE
===================================================== */
.table-actions { display: flex; gap: 4px; align-items: center; }

/* =====================================================
   EMPTY STATE
===================================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg { fill: #cbd5e0; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-dark); }
.empty-state p { font-size: 14px; }

/* =====================================================
   DETAIL VIEW
===================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0;
}

.detail-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.detail-value { font-size: 14px; color: var(--text-dark); font-weight: 500; }

/* =====================================================
   BREADCRUMB
===================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a { color: var(--orange); }
.breadcrumb-sep { color: var(--border); }

/* =====================================================
   LANDING PAGE
===================================================== */
.landing-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2332 0%, #2d3d56 50%, #1a2332 100%);
    display: flex;
    flex-direction: column;
}

.landing-header {
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-header .logo img { max-height: 40px; 
    /*filter: brightness(0) invert(1); */}

.landing-nav { display: flex; gap: 12px; }
.landing-nav .btn { padding: 8px 20px; }

.landing-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

.hero-content {
    text-align: center;
    color: white;
    max-width: 680px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content h1 span { color: var(--orange); }

.hero-content p {
    font-size: 18px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 36px;
    line-height: 1.6;
}

.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn-xl { padding: 14px 36px; font-size: 16px; border-radius: 10px; }

.btn-outline-white {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline-white:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: white;
}

.landing-features {
    padding: 60px 40px;
    background: rgba(255,255,255,0.03);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 28px 24px;
    color: white;
    text-align: center;
    transition: background var(--transition);
}

.feature-card:hover { background: rgba(255,255,255,0.08); }

.feature-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: var(--orange-light);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    color: var(--orange);
}
.feature-icon svg { fill: currentColor; }

.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 13.5px; color: rgba(255,255,255,0.65); line-height: 1.5; }

.landing-footer {
    padding: 24px 40px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* =====================================================
   AUTH PAGES
===================================================== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2332 0%, #2d3d56 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo img {
    max-height: 44px;
    max-width: 180px;
    object-fit: contain;
}

.auth-logo .logo-placeholder {
    font-size: 28px;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: -1px;
}

.auth-box h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-link a { color: var(--orange); font-weight: 600; }

.divider {
    border: none; border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* =====================================================
   INVOICE PRINT
===================================================== */
.invoice-doc {
    background: white;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

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

.invoice-from h2 { font-size: 20px; font-weight: 800; color: var(--orange); margin-bottom: 4px; }
.invoice-from p  { font-size: 13px; color: var(--text-muted); }

.invoice-meta h1 { font-size: 26px; font-weight: 800; color: var(--text-dark); text-align: right; }
.invoice-meta-row { display: flex; gap: 16px; justify-content: flex-end; margin-top: 8px; font-size: 13px; }
.invoice-meta-label { color: var(--text-muted); }
.invoice-meta-value { font-weight: 600; }

.invoice-addresses { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.invoice-address h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; }
.invoice-address p  { font-size: 14px; line-height: 1.7; }

.invoice-table { margin-bottom: 24px; }
.invoice-table table thead th { background: var(--sidebar-bg); color: white; }
.invoice-totals { display: flex; justify-content: flex-end; }
.invoice-totals-box { width: 280px; }
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.totals-row.total { font-weight: 700; font-size: 16px; border-bottom: none; padding-top: 12px; }
.totals-row.total .amount { color: var(--orange); }

/* =====================================================
   SEARCH & FILTERS
===================================================== */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    min-width: 260px;
}

.search-box svg { fill: var(--text-muted); flex-shrink: 0; }

.search-box input {
    border: none; background: none;
    font-size: 14px; outline: none; width: 100%; padding: 0;
}

/* =====================================================
   PAGINATION
===================================================== */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding-top: 16px;
}

.page-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: white;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-dark);
    transition: var(--transition);
    text-decoration: none;
}

.page-btn:hover { border-color: var(--orange); color: var(--orange); text-decoration: none; }
.page-btn.active { background: var(--orange); color: white; border-color: var(--orange); }

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .sidebar {
        transform: translateX(-250px);
        width: 250px;
    }

    .sidebar.open { transform: translateX(0); }

    .main-content { margin-left: 0; }

    .sidebar-toggle { display: flex; }

    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }

    .hero-content h1 { font-size: 32px; }
    .landing-header { padding: 16px 20px; }
    .landing-hero { padding: 40px 20px; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .page-content { padding: 16px; }

    .invoice-header { flex-direction: column; gap: 20px; }
    .invoice-addresses { grid-template-columns: 1fr; }
    .invoice-meta h1 { text-align: left; }
    .invoice-meta-row { justify-content: flex-start; }
}

/* =====================================================
   PRINT STYLES
===================================================== */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin-left: 0; }
    .page-content { padding: 0; }
    body { background: white; }
    .card { box-shadow: none; border: none; }
}
